Re: Sorting NSArray -- advice on how to accomplish a "simple" alpha ordering?
Re: Sorting NSArray -- advice on how to accomplish a "simple" alpha ordering?
- Subject: Re: Sorting NSArray -- advice on how to accomplish a "simple" alpha ordering?
- From: Graham Cox <email@hidden>
- Date: Wed, 01 Aug 2012 15:07:48 +1000
On 01/08/2012, at 3:01 PM, Erik Stainsby wrote:
> The NSSortDescriptor documentation seems especially opaque to me tonight.
> Surely there is a useful short description somewhere … ? *whimper*
Sort descriptors are quite easy to use - what's the specific problem?
warning: typed into Mail:
NSSortDescriptor* desc = [NSSortDescriptor sortDescriptorWithKey:@"compare:" ascending:YES];
[myArray sortUsingDescriptors:[NSArray arrayWithObject:desc]]; //<-- myArray assumed to be an NSMutableArray
note that for this simple case, using a sort descriptor might not the most efficient solution.
--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