I am just looking at sorting an NSArray
of NSNumbers
into numeric order but am a little unsure of the best way to go. By my way of thinking 001 and 002
You don't need a mutable array at all. You can just do:
NSArray* sortedArray = [arrayNumbers sortedArrayUsingSelector:@selector(compare:)];
NSArray* sortedArray = [arrayNumbers sortedArrayUsingSelector:@selector(compare:)];
I think you can just call
return [arrayNumbers sortedArrayUsingSelector:@selector(compare:)];