I have some data like this :
1, 111, 2, 333, 45, 67, 322, 4445
NSArray *array = [[myData allKeys]sortedArrayUsingSelector: @selector(compare:)];
Implement your own method that returns NSComparisonResult. It can be in a category if you wish.
NSComparisonResult