Re: sorting an array of dictionaries
Re: sorting an array of dictionaries
- Subject: Re: sorting an array of dictionaries
- From: Andy Lee <email@hidden>
- Date: Mon, 1 May 2006 07:56:18 -0400
On May 1, 2006, at 7:39 AM, Nicko van Someren wrote:
Take a look at the NSSortDescriptor class. You should be able to
do what you want with:
NSSortDescriptot *d = [[[NSSortDescriptor alloc] initWithKey:
@"name" ascending: YES] autorelease];
NSArray *sorted = [myArray sortedArrayUsingDescriptors: [NSArray
arrayWithObject: d]];
And if you want to sort the array in place, you can use -
sortUsingDescriptors: (you did mention that you're using a mutable
array).
--Andy
_______________________________________________
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