Re: Using NSKeyedArchiver to save and restore state on iPhone apps
Re: Using NSKeyedArchiver to save and restore state on iPhone apps
- Subject: Re: Using NSKeyedArchiver to save and restore state on iPhone apps
- From: Jens Alfke <email@hidden>
- Date: Wed, 10 Feb 2010 12:12:54 -0800
On Feb 10, 2010, at 10:40 AM, Jason Bobier wrote:
> In theory, the archived navcontroller should contain my complex view controller hierarchy and all of the related views, so this should work.
> However, when I unarchive and add to view to the window, the subviews rarely have all of their values set correctly despite being supposedly NSCoding compliant. (For example, I have a button that fails to have it's target and action set)
There's more to nib loading than just unarchiving views. I don't think this is unlikely to work.
I don't think it should be necessary, either: it's a violation of MVC. The persistent data is the model; that's what you want to save. The views are configured at runtime to reflect the state of the model.
One practical problem with your approach would be if you ever change the design of your view hierarchy in a future release. Now you have a complex schema-migration problem when existing users launch the new version of the app and load an obsolete view hierarchy.
—Jens_______________________________________________
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