How to sort an NSMutableArray of objects by a member of its class, that is an int or float
- by J. Dave
I have a class (from NSObject) that contains:
NSString name
int position
float speed
I then create an array (NSMutableArray) of objects from this class. I would like to then sort the array by the 'speed' value, which is a float.
I initially has the float value as an NSNumber and the int as NSInteger, and I was successfully sorting…