Wednesday, 8 February 2012

NSMutableDictionary and Ordering

Interesting little problem:

I have a mutable dictionary but when I call NSArray = [NSMutableDictionary allObjects];

I get an array of objects but they are in a different order to the order I added them to the dictionary.

So now I have to set up some kind of sort function.

2 comments:

  1. You could try and create mutable array and loop through the dictionary and add in a order you wish

    Dan

    ReplyDelete
  2. Ye that was my plan B I was hopping there would be an easier way considering this must be something people do on a regular basis.

    Looks like ill be writing another snipit it for my code folder :)

    ReplyDelete