I have an NSArray
of NSDictionaries
. In the NSDictionary
I have an element called 'rowID' which is saved as an NSString
. However, everything saved in it is a number even though they saved as a string.
I would like to know how to sort the array based on this value but in terms of sorting 1-100. Currently, when I sort it 10 comes first when it should be 1-10.
This is how I am sorting:
NSArray *tempSortedItemsArray = [itemArray sortedArrayUsingDescriptors:
@[[NSSortDescriptor
sortDescriptorWithKey:@"rowID" ascending:YES]]];