Skip to content

Instantly share code, notes, and snippets.

@jaisonv jaisonv/SortArray.m

Last active Jul 25, 2016
What would you like to do?
Sort array
// 'date' is the property with the date to be sorted by
NSSortDescriptor *dateDescriptor = [NSSortDescriptor sortDescriptorWithKey:@"date" ascending:YES];
NSArray *sortDescriptors = [NSArray arrayWithObject:dateDescriptor];
// 'myArray' is the array that will be sorted
NSArray *sortedEventArray = [myArray sortedArrayUsingDescriptors:sortDescriptors];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.