Can someone please show me the code for sorting an NSMutableArray? I have the following NSMutableArray:
NSMutableArray *arr = [[NSMutableArray alloc] init];
You should use this method:
[arr sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
in a NSArray
or:
[arr sortUsingSelector:@selector(caseInsensitiveCompare:)];
in a "inplace" sorting NSMutableArray
The comparator should return one of this values:
NSOrderedAscending
NSOrderedDescending
NSOrderedSame