Josh Kahane Josh Kahane - 2 months ago 6x
Objective-C Question

Sort Numbers in NSArray?

This is driving me up the wall and I can't piece together how to do this.

I fetch my array from a plist, this array is full of numbers (as set in the plist). Now al I need to do is sort them so they are descending, but I can't work it out.

Hope someone can help out, thanks.


Try this code?

 NSArray *array = /* loaded from file */;
 array = [array sortedArrayUsingSelector: @selector(compare:)];