I am trying to write a method which will allow me to keep the order of my NSMutableDictionary
keys when they are being inserted into the data structure. I know that the NSMutableDictionary
works of a hash map, hence not maintaining specific order.
So I need to somehow keep track of the keys which are being inserted into the dictionary, and when retrieving the values from the dictionary, the keys are to be printed(key values) in this same order as when originally inserted. The keys which are inserted into the dictionary are alphanumeric. They just need to be printed out in the same order as when inserted into the NSMutableDictionary
.
Can this be achieved? I would like to remain using the NSDictionary
Data Structure.