Re: DeepCopy Arrays and Dictionaries
Re: DeepCopy Arrays and Dictionaries
- Subject: Re: DeepCopy Arrays and Dictionaries
- From: Dave <email@hidden>
- Date: Mon, 25 Jan 2016 17:46:14 +0000
There are two copies, the MASTER, this is never touched, I generate this from the initial load.
At some later stage, something gets woken up saying that Network in online. When this happens I want a R/W Network that gets saved separately when the Network goes offline. This file then gets used in two ways, when the app reloads it uses this new copy as the Master and the process repeats.
At somepont some other process comes along and updates the main database with the current file, then removes it and the process repeats.
It’s not a premature optimisation because I have there that is taking too long, hence the need to do this archiving etc. Once the Network wakes up, I need to start catching updates about which nodes are on and offline etc.
All the Best
Dave
> On 25 Jan 2016, at 16: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