0

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".

Chris Loonam
  • 5,735
  • 6
  • 41
  • 63
Tomer Peled
  • 3,571
  • 5
  • 35
  • 57

1 Answers1

0

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

self.window.rootViewController = myUINavigationController;
Mike
  • 9,765
  • 5
  • 34
  • 59
  • As I wrote in the above comments , the UINavigationController shouldn't be the root view controller of the my app - we have some other viewconroller which should be the root view controller. – Tomer Peled Aug 24 '14 at 05:55
  • What's the point of this? What is your use case? Why not present it modally? – Mike Aug 24 '14 at 06:12
  • I actually use the presentModalViewController (presentViewController after deprecation) in order to show it modally, but from some reason the view is removed from the window hierarchy - notice that this isn't the case in lower iOS version... – Tomer Peled Aug 24 '14 at 06:26
  • Also, presenting a modal view controller works just fine for me in iOS8. Show some code, you're likely doing something wrong somewhere else. – Mike Aug 24 '14 at 06:31
  • I'm meant that I'm using the presentViewController instead of the presentModalViewController – Tomer Peled Aug 24 '14 at 06:35
  • I'm looking for the cause to this behaviour - will keep you updated. – Tomer Peled Aug 24 '14 at 06:47