Skip to content

Instantly share code, notes, and snippets.

@jodell
Created February 28, 2012 21:49
Show Gist options
  • Save jodell/1935388 to your computer and use it in GitHub Desktop.
Save jodell/1935388 to your computer and use it in GitHub Desktop.
Sort with a block
NSArray *sorted = [self.buy.placements sortedArrayUsingComparator:^(id a, id b) {
return [[(Placement *)a position] compare:[(Placement *)b position]];
}];
self.buy.placements = [NSMutableArray arrayWithArray:sorted];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment