Created
April 3, 2012 19:15
-
-
Save egold/2294834 to your computer and use it in GitHub Desktop.
Quickie NSArray sorting
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
NSSortDescriptor* sortByDate = [NSSortDescriptor sortDescriptorWithKey:@"createdDate" ascending:NO]; | |
allReminders = [allReminders sortedArrayUsingDescriptors:[NSArray arrayWithObject:sortByDate]]; | |
self.reminders = [NSMutableArray arrayWithArray:allReminders]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There are more flexible ways to sort NSArrays using blocks or custom methods, but this covers 90% of cases