• 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: -[NSMutableSet randomObject]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: -[NSMutableSet randomObject]


  • Subject: Re: -[NSMutableSet randomObject]
  • From: Dave DeLong <email@hidden>
  • Date: Tue, 25 May 2010 11:07:49 -0600

Since an NSSet is, by definition, unordered, the allObjects method is not guaranteed to return the same ordering of objects every time.  However, once you have the array, you could easily order it yourself using sortedArrayUsing(Selector/Comparator/Descriptors):.

And I've used this code (or really similar code) in production stuff before.

Dave

On May 25, 2010, at 10:58 AM, Michael A. Crawford wrote:

> Hey, not bad.  Does the -allObjects method always return the same sequence?  Did you just cobble this up or is this running in a system somewhere?  It doesn't do everything I want but it is definitely the better part of the 80/20 rule.
>
> -Michael

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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: 
 >-[NSMutableSet randomObject] (From: "Michael A. Crawford" <email@hidden>)
 >Re: -[NSMutableSet randomObject] (From: Dave DeLong <email@hidden>)
 >Re: -[NSMutableSet randomObject] (From: "Michael A. Crawford" <email@hidden>)

  • Prev by Date: Re: -[NSMutableSet randomObject]
  • Next by Date: Re: Deallocation while key value observers still registered
  • Previous by thread: Re: -[NSMutableSet randomObject]
  • Next by thread: Re: -[NSMutableSet randomObject]
  • Index(es):
    • Date
    • Thread