Can someone please show me the code for sorting an NSMutableArray? I have the following NSMutableArray:
NSMutableArray *arr = [[NSMutableArray alloc] init];
It's pretty simple to write your own comparison method for strings:
@implementation NSString(compare)
-(NSComparisonResult)compareNumberStrings:(NSString *)str {
NSNumber * me = [NSNumber numberWithInt:[self intValue]];
NSNumber * you = [NSNumber numberWithInt:[str intValue]];
return [you compare:me];
}
@end