Re: -[NSSet containsObject:] returns NO when it should return YES
Re: -[NSSet containsObject:] returns NO when it should return YES
- Subject: Re: -[NSSet containsObject:] returns NO when it should return YES
- From: Jim Correia <email@hidden>
- Date: Sat, 19 Feb 2011 14:43:49 -0800
On Feb 19, 2011, at 2:17 PM, Michael Crawford wrote:
> I'm trying to compare instances of NSNumber using NSSet. I have a set of numbers, which represent 64-bit persistent IDs for iTunes media-items. I access these values using the -[NSNumber longLongValue] method. I'm adding them to an instance of NSSet and then use that instance to determine whether or not I've seen the given item before.
> Anyone have previous experience with this problem? Can you shed some light on where my thinking and assumptions are wrong.
The documentation for -[NSSet containsObject:] says:
Return Value — YES if anObject is present in the set, otherwise NO.
The documentation for -[NSSet member:] says:
Return Value — If the set contains an object equal to object (as determined by isEqual:) then that object (typically this will be object), otherwise nil.
Jim
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden