Re: Archiving/unarchiving root objects using instance methods
Re: Archiving/unarchiving root objects using instance methods
- Subject: Re: Archiving/unarchiving root objects using instance methods
- From: Graham Cox <email@hidden>
- Date: Tue, 10 Mar 2009 12:42:19 +1100
On 10/03/2009, at 6:59 AM, Paul Kim wrote:
I have to encode the object with the undocumented "root" key.
And yes, for practical reasons, using the "root" key will work
because of backwards compatibility but it would be nice if there
were an official way to do this (or some semi-official word that
using the "root" key is ok).
This isn't, of course, official in any way.
I use the "root" key also and expect it won't change. If Apple ever
decided on some strange whim to do that, they'd break all existing
archives out there or else have to add extra code to accept the
existence of the "root" key in all those older archives. What would be
the point?
As far as I could discover, if you need a delegate, you have no choice
but to use "root". This fact pretty much forces Apple's hand since
it's their error that they haven't documented or exposed this, but the
wide existence of archives that must assume it means that they pretty
much have to support it forever after.
Also, if it really concerns you, you could create your archiver
manually also, using "root" as your explicit root key. That way you've
supplied it at both ends and so your code would be proof against Apple
ever changing this for the convenience methods.
File a documentation bug also - it'll be a dupe but at least this
flags up the fact that it matters to devs.
--Graham
_______________________________________________
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