Search code examples
iphoneobjective-cioscocoa-touchnskeyedarchiver

Object order for NSKeyedArchiver


As per my understanding full object graph is stored using:

NSKeyedArchiver archiveRootObject

and it gets retrieved in the same 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.


Solution

  • 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.