On Jan 7, 2011, at 10:36 AM, Jon Sigman wrote: > The underlying issue I was having was how to know when different objects used > as > keys might be reasonably expected to match, especially if they weren't > generated > the same way (as with [NSNumber stringValue] and [NSString ...]). > > I guess the long answer is "its complicated", and the short answer is "just > use > NSStrings". > > Thanks to all, I think I'm getting the hang of it.
The long and short answers are both "they won't". The non-trivial isEqual methods check the object's class; an NSString can be equal to an NSMutableString if their contents match, but never an NSNumber. Hash is a secondary check._______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com