I have a UITabBarController in storyboard which has a navigation controller as one of the tab bar items. When I try to do [self presentViewController:myVC animated:YES completion:NULL]
on the root view-controller of my navigation controller, the application stops responding and I get the following error/warning on the console
2015-10-16 18:21:40.175 My_App[1224:488753] Presenting view controllers on detached view controllers is discouraged <MyViewController: 0x16512b00>.
I am experiencing this issue only when the app is built using Xcode-7.0.1 and run on iOS-9. It works perfectly on iOS-8 with Xcode-7.0.1 and even on iOS-9 when built using Xcode 6.4.
Edit:
This is my view controller hierarchy just before I present myVC
from myRootViewController
.
(lldb) po [UIViewController _printHierarchy]
<LibraryTabBarController 0x7f91935e9660>, state: appeared, view: <UILayoutContainerView 0x7f9195841420>
| <UINavigationController 0x7fe46b863200>, state: appeared, view: <UILayoutContainerView 0x7fe46b54c6a0>
| | <MyRootViewController 0x7fe46b47aa40>, state: appeared, view: <UIView 0x7fe46b66f8a0>
| <MyOtherViewController 0x7f919580fd80>, state: disappeared, view: (view not loaded)