Skip to content

Instantly share code, notes, and snippets.

@josephchang10
Created January 23, 2017 02:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josephchang10/79c8fb1432eabb794636b2ef1a70698e to your computer and use it in GitHub Desktop.
Save josephchang10/79c8fb1432eabb794636b2ef1a70698e to your computer and use it in GitHub Desktop.
Best way to sort an NSArray of NSDictionary objects
NSSortDescriptor * descriptor = [[NSSortDescriptor alloc] initWithKey:@"interest" ascending:YES];
stories = [stories sortedArrayUsingDescriptors:@[descriptor]];
recent = [stories copy];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment