Object order for NSKeyedArchiver
As per my understanding full object graph is stored using:
NSKeyedArchiver archiveRootObject
and it gets retrieved in the same开发者_Python百科 order it was saved, is this correct?
I am getting a NSDictionary and want to save the objects in the same order in which it was received.
If your NSDictionary contains an array (as you stated in a comment on a different answer), that array will be preserved. NSKeyedArchiver simply saves the object, it doesn't have anything to do with the order. So to answer your question, yes.
The order of elements in NSDictionary is undefined, so even if you read them in the same order as they were written and then iterate through them, the order may not be the same as initially.
精彩评论