Bravendary
Bravendary

Reputation: 113

NSMutableDictionary Enumeration

I used both object and key NSEnumerators to look through a dictionary and I noticed that it changes the order in which it enumerates through the dictionary. I find that rather annoying. Is there a way to get the NSEnumerator object or key, to look through in the order in which I created it? Formatting it into an NSArray isn't an option.

Upvotes: 0

Views: 475

Answers (2)

Pierre Houston
Pierre Houston

Reputation: 1641

found via this thread last year, you'll find a good OrderedDictionary class here

Upvotes: 0

Marko Hlebar
Marko Hlebar

Reputation: 1973

a dictionary is inherently not an ordered set so it doesn't matter in which order you store your data in it. you could use an nsarray and store your keys in it and then invoke your objects from the dictionary in the order stored in that array.

Upvotes: 2

Related Questions