Skip to content

Instantly share code, notes, and snippets.

@tudormunteanu
Created August 15, 2012 09:57
Show Gist options
  • Select an option

  • Save tudormunteanu/3358337 to your computer and use it in GitHub Desktop.

Select an option

Save tudormunteanu/3358337 to your computer and use it in GitHub Desktop.
Sort NSArray of NSDicts by a key
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