• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Using NSKeyedArchiver to save and restore state on iPhone apps
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Using NSKeyedArchiver to save and restore state on iPhone apps
      • From: Jason Bobier <email@hidden>
References: 
 >Using NSKeyedArchiver to save and restore state on iPhone apps (From: Jason Bobier <email@hidden>)

  • Prev by Date: Re: Is a good practice to alloc an object and defer the initialization to another object?
  • Next by Date: Re: Large queue of messages for another app
  • Previous by thread: Using NSKeyedArchiver to save and restore state on iPhone apps
  • Next by thread: Re: Using NSKeyedArchiver to save and restore state on iPhone apps
  • Index(es):
    • Date
    • Thread