Created
March 13, 2015 06:18
-
-
Save Eridana/92bd0cc8dc0e88cb3773 to your computer and use it in GitHub Desktop.
Sorting array of custon objects by date property
This file contains hidden or 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
NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"thisIsTheNameOfYourDateProperty" ascending:NO]; | |
NSArray *orderedArray = [arrayOfCustomObjects sortedArrayUsingDescriptors:[NSArray arrayWithObject:sortDescriptor]]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment