state-restoration

NSViewControllers and NSViews are not getting restoration API calls

被刻印的时光 ゝ 提交于 2019-12-07 00:00:42
问题 in Apple's documentation they say that in case of document-based apps you should get restoration calls (restoreStateWithCoder: and encodeRestorableStateWithCoder:) to NSApplication, NSWindow, NSWindowController and then the whole responder chain (here). I want to implement this, but I'm getting the restoration calls only in NSWindowController/NSDocument subclass, not the NSViews or NSViewControllers. I created a new document-based app to test this (here), but I get the restoration calls only

NSViewControllers and NSViews are not getting restoration API calls

隐身守侯 提交于 2019-12-05 04:43:25
in Apple's documentation they say that in case of document-based apps you should get restoration calls (restoreStateWithCoder: and encodeRestorableStateWithCoder:) to NSApplication, NSWindow, NSWindowController and then the whole responder chain ( here ). I want to implement this, but I'm getting the restoration calls only in NSWindowController/NSDocument subclass, not the NSViews or NSViewControllers. I created a new document-based app to test this ( here ), but I get the restoration calls only in the NSDocument subclass but not the NSViewController or NSView. Code from the test project:

UISplitViewController state restoration in iOS 8

筅森魡賤 提交于 2019-12-05 02:15:29
问题 On iOS 8, UISplitViewController appears to save and restore the state of its subviews, for example, whether the master view is hidden or not. This is undesirable because my app should always show the master view in landscape and always hide it in portrait. If the user closes the app in landscape (landscape state is saved) and reopens it in portrait (landscape state is restored), then the UISplitViewController shows the master view in the wrong configuration. I still need to supply a

Cryptic warning without any google results [In Simulator]

无人久伴 提交于 2019-12-04 23:58:30
I get this warning in my iOS project: (iOS7, XCode 5 GM) Warning: Unable to create restoration in progress marker file I am working on a viewcontroller that turns all black when I get this warning on startup. Deleting the app and restarting XCode sometimes seems to help. I am returning NO on both -(BOOL)application:(UIApplication *)application shouldRestoreApplicationState: -(BOOL)application:(UIApplication *)application shouldSaveApplicationState: Update1: I tested on iPhone4s. Same result. Warning and black screen on my view controller. Update2: Answered my own question for the black screen.

iOS state restoration animation bug

 ̄綄美尐妖づ 提交于 2019-12-04 06:29:30
I just wanted to implement the iOS State-Restoration APIs in one of my Apps. After finally getting it to work, I discovered that a ViewController that I present modally gets restored using an animation, which is not what I want. I would expect my app to just be in the state I left it, but not having the user to see hot he got there. So I went ahead and downloaded Apple Sample Code on that: https://developer.apple.com/library/ios/samplecode/StateRestore/Introduction/Intro.html and wanted to see if it happens there as well. And it turns out that it does. Further there is a warning in the Logs:

UISplitViewController state restoration in iOS 8

…衆ロ難τιáo~ 提交于 2019-12-03 20:06:50
On iOS 8, UISplitViewController appears to save and restore the state of its subviews, for example, whether the master view is hidden or not. This is undesirable because my app should always show the master view in landscape and always hide it in portrait. If the user closes the app in landscape (landscape state is saved) and reopens it in portrait (landscape state is restored), then the UISplitViewController shows the master view in the wrong configuration. I still need to supply a restoration identifier to the UISplitViewController so that is subview controllers have their own state saved

UINavigationController State Restoration (without Storyboards)

蹲街弑〆低调 提交于 2019-12-02 22:34:06
I've been toying around with state restoration. In the code below, the scroll position of the UITableViewController gets restored, however, if I were to tap through into the detail view (pushing an instance of MyViewController onto the navigation stack), when the app restarts, it always returns to the first view controller in the navigation stack (i.e. MyTableViewController). Would somebody be able to help me restore to the correct view controller (i.e. MyOtherViewController)? AppDelegate.m - (BOOL)launchWithOptions:(NSDictionary *)launchOptions { static dispatch_once_t onceToken; dispatch

Is iOS state restoration possible in iOS library? — Could not find a storyboard named

試著忘記壹切 提交于 2019-12-02 00:55:29
问题 I have a library with a storyboard and controller classes that implement iOS state preservation. To launch the library from the main app's delegate, I use the following: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds]; [self.window makeKeyAndVisible]; self.window.rootViewController = myLibrary.sharedInstance.firstController; return YES; } Then inside my

How to trigger Core Bluetooth state preservation and restoration

本小妞迷上赌 提交于 2019-11-29 02:25:55
State Preservation and Restoration Because state preservation and restoration is built in to Core Bluetooth, your app can opt in to this feature to ask the system to preserve the state of your app’s central and peripheral managers and to continue performing certain Bluetooth-related tasks on their behalf, even when your app is no longer running. When one of these tasks completes, the system relaunches your app into the background and gives your app the opportunity to restore its state and to handle the event appropriately. In the case of the home security app described above, the system would

How to trigger Core Bluetooth state preservation and restoration

冷暖自知 提交于 2019-11-27 15:12:20
问题 State Preservation and Restoration Because state preservation and restoration is built in to Core Bluetooth, your app can opt in to this feature to ask the system to preserve the state of your app’s central and peripheral managers and to continue performing certain Bluetooth-related tasks on their behalf, even when your app is no longer running. When one of these tasks completes, the system relaunches your app into the background and gives your app the opportunity to restore its state and to