I have an array of powders i'd like to sort buy how many pounds of them I have
Each powder is a object with properties one of them being powderQuantity
@interface PowderObject : NSObject <NSCoding>
@property (nonatomic, retain) NSString *powderName;
//Powder Quantity is in pounds
@property (nonatomic, assign) double powderQuantity;
@property (nonatomic, assign) int numberID;
@property (nonatomic, retain) NSString *description;
@end
That is my header for the object I have been storing them in an array by
NSMutableArray *arrayOfPowders = [[PowderDataClass listPowders] mutableCopy];
That line returns all of the powders I have, and then after I get them I'd like to sort them by the weight left of them (powderQuantity). Highest goes first and the least goes last. I've tried using for loops, but have found them very inefficient, and haven't got them to work properly.
Thanks for any help in advance