Re: -[NSMutableSet randomObject]
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