View is not in the window hierarchy

441 Views Asked by At

I'm encountering with a weird issue on iOS 8 the latest beta. My view is disappearing from the window hierarchy in oppose to iOS7 - basically I'm replacing my UINavigationController with a new one at some point. This code worked with no issues until iOS 8 , any idea why? If I'm adding the UINavigationController to the keyWindow - it actually bypass this issue and the view actually "stays" in the window hierarchy :

[[[UIApplication sharedApplication] keyWindow] addSubview:myUINavigationController];

But I don't like this "hack".

1

There are 1 best solutions below

6
On

I think what you're looking for is this in your AppDelegate's didFinishLaunchingWithOptions method:

self.window.rootViewController = myUINavigationController;