Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Adam Fisch
3,772 PointsSaving the state of a UIViewController
I am trying to build an app with a UIViewController that the user can dynamically add thumbnails and text labels to. The view controller is within a navigation controller. I want to save the state so anything added to it is preserved when the app is quit and restarted.
I have added Restoration ID's via the storyboard to the view controller and its parent navigation controller, and included encodeRestorableStateWithCoder and decodeRestorableStateWithCoder methods to viewController.m. I have also included shouldSaveApplicationState and shouldRestoreApplicationState methods in AppDelegate.m. Right now, the view is preserved when minimized but not when quit and restarted.
What am I missing?