• 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: Shawn Erickson <email@hidden>
  • Date: Thu, 10 Mar 2005 11:45:35 -0800


On Mar 10, 2005, at 11:29 AM, Mike R. Manzano wrote:

Anyone know if NSSets are faster than NSArrays?

Faster "than" when doing what?

Why wouldn't I always just use an NSArray?

This a trick question? ;-) The answer is when NSSet is a better fit for what you are doing then NSArray.


Review the docs for both classes and think about the difference on what they do, for example one allows you to access items primarily by index the other by object comparison, one is ordered the other isn't, one allows duplicate objects in the collection the other doesn't, etc.

You may want to review the following...
<http://developer.apple.com/documentation/Cocoa/Conceptual/Collections/ index.html>


Anyway we can't help much other then guess at what type of comparison you want between these two collection classes... we need to know more about what you want to use them for.

-Shawn

_______________________________________________
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


  • Follow-Ups:
    • Re: NSArray vs. NSSet
      • From: "Mike R. Manzano" <email@hidden>
References: 
 >NSArray vs. NSSet (From: "Mike R. Manzano" <email@hidden>)

  • Prev by Date: NSArray vs. NSSet
  • Next by Date: Re: NSArray vs. NSSet
  • Previous by thread: NSArray vs. NSSet
  • Next by thread: Re: NSArray vs. NSSet
  • Index(es):
    • Date
    • Thread