Questions tagged [state-restoration]

On iOS, State Preservation and Restoration can be used to save and reload app state to make app termination appear like a temporary interruption. When an apps state is restored, the app returns the user to the last point of use so that the user can continue with whatever task was in progress.

iOS Programming Guide - State Preservation and Restoration:

The state preservation system in UIKit provides a simple but flexible infrastructure for preserving and restoring the state of your app’s view controllers and views. The job of the infrastructure is to drive the preservation and restoration processes at the appropriate times. To do that, UIKit needs help from your app. Only you understand the content of your app, and so only you can write the code needed to save and restore that content. And when you update your app’s UI, only you know how to map older preserved content to the newer objects in your interface.

126 questions
0
votes
0 answers

error received when restoring state to view in navigation controller in iOS

When my app starts up I receive the following error: Exception occurred restoring state Could not find a navigation controller for segue 'mySegue'. Push segues can only be used when the source controller is managed by an instance of…
Atma
  • 25,661
  • 50
  • 173
  • 276
0
votes
1 answer

app delege didfinishlaunching not called during state restoration in iOS

I have several setup methods that are essential to running my app. They are called in the app delegates did finish lanching with options. I am using state restoration and my app is now failing because when the app is restored, it does not call this…
Atma
  • 25,661
  • 50
  • 173
  • 276
0
votes
3 answers

Set NSDate when app goes in background, save and restore it with state restoration

My app has a timer which when the app goes in the background pauses. To still have the right time when the app comes back in the foreground, I set an NSDate called exitDate in the AppDelegate as follows: -…
0
votes
1 answer

UIKit restoration not calling viewControllerWithRestoreIdentifierPath on all VC

Overview of my app -Throughout I use a navigation controller, it lies in a corresponding XIB MainWindow.xib. It is set as the root vc in the app delegate. -CategoriesVC is a table vc, it is the top VC in the root vc. -BooksCategoryVC (all books in…
H.Rabiee
  • 3,918
  • 3
  • 20
  • 34
-1
votes
1 answer

Could work an app then reboot iPhone?

I have an iOS Objective-C application, and this implements a store restoration function. But if I reboot my iPhone while my app is running... they continue working before reboot? I'm trying reboot my iPhone and apps in the background continue…
user3745888
  • 5,443
  • 14
  • 43
  • 85
-3
votes
1 answer

How to rewrite this encoding for a UISwitch and also how to decode it?

I'm trying to save the state of some switches and restore it when the app launches again but when I wrote this : override func encodeRestorableState(with coder: NSCoder) { super.encodeRestorableState(with: coder) …
Dave19
  • 67
  • 1
  • 6
1 2 3
8
9