Re: Question about Archives and Serialisations Programming Guide
Re: Question about Archives and Serialisations Programming Guide
- Subject: Re: Question about Archives and Serialisations Programming Guide
- From: Dave <email@hidden>
- Date: Fri, 05 Feb 2016 17:12:15 +0000
> On 5 Feb 2016, at 17:04, Quincey Morris <email@hidden> wrote:
>
> On Feb 5, 2016, at 07:27 , Dave <email@hidden <mailto:email@hidden>> wrote:
>>
>> If you set it strong, then it creates a dupe of the object over and over again, as I said in the other thread
>
> a. If that’s the case, then your problem is nothing to do with the weak references. Something is causing those objects to be *either* archived as unique objects (copies) *or* copied after unarchiving. As others have repeatedly stated, object uniqueness *is* maintained through archiving and unarchiving, and if you’re following the idea that there’s something wrong with NSKeyedArchiver/NSKeyedUnarchiver, then you’re almost certainly barking up the wrong tree.
Yes, I didn’t really think it was a problem with NSKeyedArchiver/NSKeyedUnarchiver, but I thought there was something more I had to do to make it work…….
Found it now and, your were right, I was using copyItems:YES in the initWithCoder which caused new Child Objects to be generated, thus causing the weakly referenced back pointers to be zero’ed…..
Thanks for the explanation, I haven’t found anything that states it as plainly…..
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