Re: NSArray vs. NSSet
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