Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Soulstorm

macrumors 68000
Original poster
Feb 1, 2005
1,887
1
I am using "+ (id)dictionaryWithContentsOfFile:(NSString *)path" to load contents from a .plist file inside my application bundle. Although the contents are parsed correctly, the keys are unordered.

For example, if I give the command "allKeys", I will get an NSArray that contains my dictionary objects inside the .plist file.

However, I will get the array with a set of keys with different order than the one I have written in the .plist file.

Is that how it is supposed to be? Am I doing something wrong? I am using Property List Editor to make the .plist file.
 
allKeys
Returns a new array containing the receiver’s keys.

- (NSArray *)allKeys

Return Value
A new array containing the receiver’s keys, or an empty array if the receiver has no entries.

Discussion
The order of the elements in the array is not defined.
 
allKeys
Returns a new array containing the receiver’s keys.

- (NSArray *)allKeys

Return Value
A new array containing the receiver’s keys, or an empty array if the receiver has no entries.

Discussion
The order of the elements in the array is not defined.

You can't imagine how much I laughed after I read this. My bad. Sorry.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.