DeepCopy Arrays and Dictionaries
DeepCopy Arrays and Dictionaries
- Subject: DeepCopy Arrays and Dictionaries
- From: Dave <email@hidden>
- Date: Sun, 24 Jan 2016 16:16:04 +0000
Which brings me to another questions, how to deep copy a network without saving it to disk?
One thing about making it NSCoding Compliant is that all my objects now support NSCopying too, e.g. define a copyWithZone method, so in order to deep copy one of my root arrays/dictionaries. can I just do this?
myDestNetwork.pArray1 = [mySourceNetwork copy];
Or do I need to use the initWithArray:xxxx copyItems:YES and initWithDictionary:xxxx copyItems:YES methods?
If I need to use the init methods, then how can I tell which method (deep or shallow) to use?
When I’m saving/restoring I want a shallow copy, but I then want to clone this network into a working copy. The working copy gets updated which the App is running and at certain points dumped to file. This file will then be used to update the database and a new prototype file generated for use by the App.
I’ve done a couple of searching and there are a lot of conflicting answers……..
Basically I need to clone off sub-networks from the main network, update them and at some point save them to disk.
Thanks for the help.
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