On Feb 19, 2011, at 19:06, Kyle Sluder wrote: > On Feb 19, 2011, at 7:01 PM, Michael Crawford <[email protected]> wrote: > >> >> I assumed this is the case because regardless of whether or not you call >> -boolValue or -longLongValue, -hash returns the same result. I've already >> shown that they do indeed contain the same value, when -longLongValue is >> called on both items. See the dbg output. > > Why do you keep fixating on -hash? There are two common definitions of > equality: -isEqual: and pointer identity. Neither of these relies on -hash.
Putting it another way: -hash is of interest only to *implementers* of certain classes. To users of classes, it's an implementation detail. > Your experience indicates that -containsObject: uses pointer identity, > whereas -member: uses -isEqual:. What's especially confusing is that -[NSArray containsObject:] is documented to use -isEqual. It seems like the NSSet method ought to be called -containsObjectIdenticalTo: for consistency (and now clarity) reasons. _______________________________________________ Cocoa-dev mailing list ([email protected]) 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 [email protected]
