Created
October 9, 2011 08:56
-
-
Save Nub/1273470 to your computer and use it in GitHub Desktop.
Apple example
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
| NSArray *sortedArray = [array sortedArrayUsingComparator: ^(id obj1, id obj2) { | |
| if ([obj1 integerValue] > [obj2 integerValue]) { | |
| return (NSComparisonResult)NSOrderedDescending; | |
| } | |
| if ([obj1 integerValue] < [obj2 integerValue]) { | |
| return (NSComparisonResult)NSOrderedAscending; | |
| } | |
| return (NSComparisonResult)NSOrderedSame; | |
| }]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment