Last active
July 25, 2016 20:45
-
-
Save jaisonv/c10d38cbb2ccfbbca1b19f35d450e095 to your computer and use it in GitHub Desktop.
Sort array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// '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