• 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: NSArray vs. NSSet
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSArray vs. NSSet


  • Subject: Re: NSArray vs. NSSet
  • From: Scott Stevenson <email@hidden>
  • Date: Thu, 10 Mar 2005 14:00:57 -0800


On Mar 10, 2005, at 12:48 PM, Tim Hart wrote:

I wouldn't be to worried about that. NSSet *is* useful, and I'm glad it's in Foundation, but its applications are a bit more specific than NSArray and NSDictionary. On average NSArray and NSDictionary are much more likely to be the right solution that NSSet.

The main reason to use an NSSet right now is that it's faster at checking for existence of an object. It's common to see an NSSet used as a cache for the contents of an NSArray or NSDictionary.


Also, an idividual object can only appear once in an NSSet, whereas it can appear multiple times in a dictionary or array.


- Scott

--
http://treehouseideas.com/
http://theocacao.com/ [blog]

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >NSArray vs. NSSet (From: "Mike R. Manzano" <email@hidden>)
 >Re: NSArray vs. NSSet (From: Shawn Erickson <email@hidden>)
 >Re: NSArray vs. NSSet (From: "Mike R. Manzano" <email@hidden>)
 >Re: NSArray vs. NSSet (From: Tim Hart <email@hidden>)

  • Prev by Date: Re: Bindings and File's Owner
  • Next by Date: evSpecialKeyMsg usage or alternative?
  • Previous by thread: Re: NSArray vs. NSSet
  • Next by thread: Re: NSArray vs. NSSet
  • Index(es):
    • Date
    • Thread