Skip to content

Instantly share code, notes, and snippets.

@inturbidus
Created January 14, 2013 01:09
Show Gist options
  • Save inturbidus/4527097 to your computer and use it in GitHub Desktop.
Save inturbidus/4527097 to your computer and use it in GitHub Desktop.
SortUsingComparator
[unsortedArray sortUsingComparator:^ NSComparisonResult(SearchResultItem *d1, SearchResultItem *d2) {
NSInteger doorID1 = d1.doorID;
NSInteger doorID2 = d2.doorID;
if (doorID1 > doorID2)
return NSOrderedAscending;
if (doorID1 < doorID2)
return NSOrderedDescending;
return [d1.handel localizedCompare: d2.handel];
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment