Skip to content

Instantly share code, notes, and snippets.

@sprohaszka
Created May 3, 2011 10:00
Show Gist options
  • Save sprohaszka/953098 to your computer and use it in GitHub Desktop.
Save sprohaszka/953098 to your computer and use it in GitHub Desktop.
Block for simple comparaison
NSComparisonResult (^sortBlock)(id, id) = ^(id obj1, id obj2) {
// Objects have a name property
NSString* name1 = [obj1 name];
NSString* name2 = [obj2 name];
return [name1 caseInsensitiveCompare:name2];
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment