Re: Archive/Unarchive Problem - Bug in MacOSX/Cocoa?
Re: Archive/Unarchive Problem - Bug in MacOSX/Cocoa?
- Subject: Re: Archive/Unarchive Problem - Bug in MacOSX/Cocoa?
- From: Keary Suska <email@hidden>
- Date: Fri, 05 Feb 2016 09:10:10 -0700
> On Feb 5, 2016, at 8:45 AM, Dave <email@hidden> wrote:
>
> Hi All,
>
> I have written a Test App that demonstrates the problem, please let me know if you’d like a copy.
>
> I’m not sure if its a bug or not and if not a bug then how to make it work. Everyone keeps telling me its possible but no one seems to know how to make it work.
>
> According to the (few) docs I found on it, its possible too, but again it doesn’t actually tell you how to do it.
>
> I’ll use up a DTS incident on this but they will take forever to respond and I jwish I knew for certain whether this is *SUPPOSED* to work or not. It doesn’t actually say in black and white one way or the other.
I would like to see a copy, as I am curious why it isn’t working. The issue isn’t that no-one knows how, it is that it is simply supposed to work. There shouldn’t be anything you need to do to encode a complex graph.
However, I can see that *decoding* the graph could be difficult. The decoding of any single object happens in the -initWithCoder: implementation of that object. One would think that until that method is exited, NSCoder cannot know that the object exists. Therefore If any of its child objects reference it, how can the coder know which object to use? I don’t know how, or if, NSKeyedUnarchiver handles this situation.
You may have to handle it yourself—i.e. do not encode “parent” properties and instead set the property value in the parents’ -initWithCoder:.
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
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