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.
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.
It work for me:
Try this code?
The following will sort the numbers in ascending order and then reverse the result to give the numbers in descending order:
This previous question has some other alternatives: Sort an NSArray in Descending Order
Here is one of many methods using comparison block. This code snippet is handy for any array with numbers that you want to sort. For Ascending order:
For Descending order:
This Will solve the problem: