I have another question about restoring application state, on the iPhone. Simple data (like the selected tab) can be stored in NSUserDefaults, but it is not enough.
I want to restore the whole state, including the Navigation Controllers (go to the sub-sub-sub View Controller).
My problem is that my application is divided in several xib files, so at the beginning, all the View Controllers are not instantiated. Is there any way to ‘force’ the instanciation from a xib file ?
(I have no code under the hand, but I can try to write a small end if it is not clear)
Thanks a lot.
Calling
[viewController view]will make sure that a given view controller’s XIB is loaded; once it is, you can use any of its other properties normally.Here’s what I tend to do:
Each level of the view hierarchy takes care of its own state saving, so the app controller doesn’t have to know about all the possible views and which orders they could be in.