Created
January 14, 2013 01:09
-
-
Save inturbidus/4527097 to your computer and use it in GitHub Desktop.
SortUsingComparator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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