Is there any way to manually discard app's saved state in iOS?

75 views Asked by At

I want to get clarified or possibly get a solution to a problem that I am facing in terms of restoring state. I successfully restore app's state on launch. I restore a view controller and other view controllers in hierarchy that was saved to disk when I pressed home button. Now when I push another view controller and sequence of other view controllers to nav. stack, at a particular view controller, for some reason the app crashes due to an exception. So when I open the app back, it still restores the first view controller's state that was preserved when pressing home button.

Specifically I want to know if there is any way to discard app state info. when app terminates due to uncaught exception? I know that the state will be discarded if user manually force-kills app, or state restoration fails, or the app terminates at launch. Is there a way to catch a termination when it occurs, and we configure app state accordingly? Suggestions would be great. Thanks.

0

There are 0 answers