I am storing data in NSMutableDictionary To store data received by web service.
I want to display data in alpha order but as we know Dictionary store data in their own way so I m getting different order for iOS 5 and iOS 6. iOS 5 it is fine but in iOS 6 it change order.
I am storing int key and object as value.
object contain ID,Name and Description.
EX:
key value
1 - (12,bhgjksd,kijdh)
6 - (13,kjfd,ikjk)
2 - (14,ljiuhbdf,dsjhfj)
How can I sort my Dictionary by Object.Name property.
or get key based on Object.Name sorting order.
I don’t want to sort on key I want to sort on Object.Name which is stored in value part as object.
Any kind of help is welcome…..
Thanks in advance..
Try this,
You will get all the keys in
sortedKeysarray, sorted in the order ofobject.nameproperty. You can use these keys to get the values from dictionary as[dict valueForKey:[sortedKeys objectAtIndex:i]]. For more details please check apple documentation.