Frage

So far, the internet has no hits for this state restoration warning that's happening to me:

-[UIViewController(StateRestoration) decodeRestorableStateWithCoder:]: Warning - State Restoration for UIViewController has presented view controller, but view controller is either not in a window, or the window is hidden. Deferring presentation which might cause flashing when presentation is made after a turn of the run loop:
self: <SomeTabBarController: 0x16e91220>, presented view controller: <UINavigationController: 0x16dbe260>

The TabBarController has a view which pushes a ViewController (vc1) onto the navigation controller. VC1 then pushes a NavigationController onto itself modally, which has it's own series of view controllers starting with vc2.

When the state is restored, it flashes back to vc1 (from the snapshot of vc2) before eventually showing vc2 again live.

If anyone has any ideas about where I can even start looking into this, that would be a great help.

War es hilfreich?

Lösung

I managed to solve this by making the window key and visible in application:willFinishLaunchingWithOptions:.

- (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [self.window makeKeyAndVisible];
    return YES;
}
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top