NSKeyedArchiver and Forwards Compatibility Strategies
NSKeyedArchiver and Forwards Compatibility Strategies
- Subject: NSKeyedArchiver and Forwards Compatibility Strategies
- From: Colin Cornaby <email@hidden>
- Date: Sat, 19 Apr 2008 12:21:04 -0700
I have an array of objects. The objects are all subclasses of one
parent class. (For the sake of this email, I will say that the
subclasses are all different kinds of graphics that can be displayed,
and the superclass defines generalities that all graphics have in
common.)
My concern here is that I may add new kinds of graphics in later
versions of my software. I would like earlier versions of my software
to read files from the later versions of my software, but obviously
the earlier versions won't be able to work with data structures that
they have no concept of.
Currently, I am thinking that I should probably set up the delegate of
my NSKeyedUnarchiver to handle unknown classes, substitute in the
superclass, and then afterwords remove any instances of the superclass
from the array. (The issue here is that the superclass cannot actually
be displayed by my software. While it defines general graphics
attributes, it doesn't define include any code necessary to actually
parse the graphical data attached to my class, and therefore probably
should be ignored by my software.)
Is this the best way to deal with this situation? Will I receive
notifications when the NSArray, which is a node of the root of the
archive, fails to unarchive one of it's objects? Is there a way I can
simply tell that NSArray not to unarchive that object as part of it's
dataset, instead of cleaning up afterwards?
Thanks,
Colin
_______________________________________________
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