• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Is this a bug of the Cocoa or the Objective-C?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Is this a bug of the Cocoa or the Objective-C?


  • Subject: Is this a bug of the Cocoa or the Objective-C?
  • From: JongAm Park <email@hidden>
  • Date: Thu, 25 Jan 2007 20:58:25 -0800

Hello,

I have a strange problem.
Here is the code that shows the problem.

while( item = [objectsEnumerator nextObject] ) {

keyString = [item valueForKeyPath:@"CF_EncodingName"];

theRange = [keyString rangeOfString:searchString options:NSLiteralSearch];


   if( theRange.location != NSNotFound ){
	[filteredObjects addObject:item];
    }
}


Let's assume that theRange has {0, 6} in the previous iteration.
if the keyString is "nil", the rangeOfString.. method returns nil.
However, it can't update the theRange variable, so it thinks that it found
the searchString.


Is this inevitable bug, because the Objective-C is a dynamic language?
Or.. is it just a bug in the Cocoa?
I guess it is an issue with the Objective-C..

Thank you.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Is this a bug of the Cocoa or the Objective-C?
      • From: Nir Soffer <email@hidden>
    • Re: Is this a bug of the Cocoa or the Objective-C?
      • From: Jérome Laurens <email@hidden>
    • Re: Is this a bug of the Cocoa or the Objective-C?
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: NSTableView, validateDrop: not called on same row
  • Next by Date: Re: Is this a bug of the Cocoa or the Objective-C?
  • Previous by thread: NSTableView, validateDrop: not called on same row
  • Next by thread: Re: Is this a bug of the Cocoa or the Objective-C?
  • Index(es):
    • Date
    • Thread