• 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: NSMutableArray fill with unique values from NSArray
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSMutableArray fill with unique values from NSArray


  • Subject: Re: NSMutableArray fill with unique values from NSArray
  • From: Graham Cox <email@hidden>
  • Date: Thu, 20 Aug 2009 22:54:34 +1000


On 20/08/2009, at 10:43 PM, Devraj Mukherjee wrote:

Is there are better way of doing this?


Use a NSMutableSet, which only accepts unique objects. You can turn it into an array later.

However you can probably do this just as easily with an array, avoiding the slowdown at the end, if you change your algorithm a bit. Isn't this pretty much the same as the "shuffle" question discussed last week?

--Graham


_______________________________________________

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: 
 >NSMutableArray fill with unique values from NSArray (From: Devraj Mukherjee <email@hidden>)

  • Prev by Date: NSMutableArray fill with unique values from NSArray
  • Next by Date: Re: NSMutableArray fill with unique values from NSArray
  • Previous by thread: NSMutableArray fill with unique values from NSArray
  • Next by thread: Re: NSMutableArray fill with unique values from NSArray
  • Index(es):
    • Date
    • Thread