• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
DeepCopy Arrays and Dictionaries
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: DeepCopy Arrays and Dictionaries
      • From: Quincey Morris <email@hidden>
References: 
 >How to save a Dictionary Network to a plist file? (From: Dave <email@hidden>)
 >Re: How to save a Dictionary Network to a plist file? (From: email@hidden)
 >Re: How to save a Dictionary Network to a plist file? (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: NSTextFields will not fully justify in 10.11
  • Next by Date: DeepCopy Arrays and Dictionaries
  • Previous by thread: Re: How to save a Dictionary Network to a plist file?
  • Next by thread: Re: DeepCopy Arrays and Dictionaries
  • Index(es):
    • Date
    • Thread