How to Handle Array of Dictionaries when Archiving/Unarchiving?
How to Handle Array of Dictionaries when Archiving/Unarchiving?
- Subject: How to Handle Array of Dictionaries when Archiving/Unarchiving?
- From: Dave <email@hidden>
- Date: Thu, 23 Jun 2016 12:21:22 +0100
Hi,
I have an Object that I Archive and Unarchive, e.g it conforms to the NSCopying and NSCoding Protocols. The Object in question contains NSArray and NSDictionary Object and I handle them like this:
initWithCoder:
myDictionary = [theCoder decodeObjectForKey:@"pLookUpDictionary "];
self.pLookUpDictionary = [[NSMutableDictionary alloc] initWithDictionary:myDictionary copyItems:NO];
encodeWithCoder:
[theCoder encodeBool: self.pLookUpDictionary forKey:@"pLookUpDictionary”];
copyWithZone:
myDictionaryCopy = [self.pLookUpDictionary mutableCopy];
myObjectCopy.pLookUpDictionary = myDictionaryCopy;
I now need to add another archivable property as so:
@property (nonatomic,strong) NSMutableDictionary<NSString*,NSArray<LTWClassX*>*>* pLookUpDictionaryArray;
How do I handle this in the above three methods? Specially do I need to walk the Array and do a mutableCopy on each of the Dictionaries in the Array?
All the Best
Dave
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden