Created
August 15, 2012 09:57
-
-
Save tudormunteanu/3358337 to your computer and use it in GitHub Desktop.
Sort NSArray of NSDicts by a key
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 *descriptor = [[NSSortDescriptor alloc] initWithKey:@"date" ascending:YES]; | |
| NSArray *preSortedFinals = [finals sortedArrayUsingDescriptors:[NSArray arrayWithObjects:descriptor, nil]]; | |
| NSArray *sortedFinals = [NSArray arrayWithArray:preSortedFinals]; | |
| [descriptor release]; | |
| return sortedFinals; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment