Say I have this:
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
dict[@1] = @2;
dict[@3] = dict;
I archive dict
by calling:
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:dict];
then I unarchive later:
NSMutableDictionary *dict2 = [NSKeyedUnarchiver unarchiveObjectWithData:data]
The problem is that dict2[@3]
is not dict2
, but rather an uninitialized NSDictionary
, and I was not able to recover what I had put in. Does anyone know how I would work around this? Thanks in advance!