• 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
Re: -[NSSet containsObject:] returns NO when it should return YES
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >-[NSSet containsObject:] returns NO when it should return YES (From: Michael Crawford <email@hidden>)

  • Prev by Date: Re: -[NSSet containsObject:] returns NO when it should return YES
  • Next by Date: Re: -[NSSet containsObject:] returns NO when it should return YES
  • Previous by thread: Re: -[NSSet containsObject:] returns NO when it should return YES
  • Next by thread: Re: -[NSSet containsObject:] returns NO when it should return YES
  • Index(es):
    • Date
    • Thread