> On 25 Sep 2016, at 8:12 PM, Dave <d...@looktowindward.com> wrote:
> 
> Is there any way that I can get the archiver to just select the Base Class 
> and ignore the extra properties in the Subclass? Or is there a better way of 
> doing this?


You mean the dearchiver.

It can have a delegate (NSKeyedUnarchiverDelegate, 
https://developer.apple.com/reference/foundation/nskeyedunarchiverdelegate?language=objc).
 It can be called when it encounters a class it doesn’t recognise, and the 
delegate can return a different class, for example the base class. It is given 
a list of the class hierarchy (as strings) so that it can do this easily.

There are also class methods for setting up class substitutions.

You could also add the extra information as a subobject within the base class, 
and simply ignore it when dearchiving.

—Graham



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to