• 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
Re: DeepCopy Arrays and Dictionaries
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DeepCopy Arrays and Dictionaries


  • Subject: Re: DeepCopy Arrays and Dictionaries
  • From: Sandor Szatmari <email@hidden>
  • Date: Mon, 25 Jan 2016 12:30:19 -0500

Caching the result could save the re-read.  However, if your data store (the file) is not opaque to the user someone will edit it and then your cache is out of sync with the file.  That may or may not be desirable, but at least it's something to incorporate into the design.

Sandor

> On Jan 25, 2016, at 11:50, Dave <email@hidden> wrote:
>
> Hi Again,
>
>> The *easy* way to do a deep copy is in fact to archive the root object and unarchive the result.
>
> Yes, I’ve come to that conclusion myself thinking about it. Apart anything else it offloads the problem nicely. In my case, I don’t need to archive it at all, I just need to load another copy of the same file……… The first load occurs at App startup and that can take as long as it needs, but I need the second load to be as fast as possible, this got me to thinking. At the moment my code does this:
>
> myNetwork = [NSKeyedUnarchiver unarchiveObjectWithFile:myFilePath];
>
> Could I hold the data read here somewhere and use that to save re-reading the file the second time around?
>
> Thanks a lot
> 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

_______________________________________________

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


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>)
 >DeepCopy Arrays and Dictionaries (From: Dave <email@hidden>)
 >Re: DeepCopy Arrays and Dictionaries (From: Quincey Morris <email@hidden>)
 >Re: DeepCopy Arrays and Dictionaries (From: Dave <email@hidden>)

  • Prev by Date: Re: DeepCopy Arrays and Dictionaries
  • Next by Date: Re: Removing Observers eats up memory
  • Previous by thread: Re: DeepCopy Arrays and Dictionaries
  • Next by thread: Re: DeepCopy Arrays and Dictionaries
  • Index(es):
    • Date
    • Thread