Here is how my current iPhone app is made:
UINavigationControllerA [viewA1 viewA2 viewA3]
viewA3 leads to UITabBarControllerB [viewB1 viewB2]
viewB2 leads to UINavigationControllerC [viewC1 viewC2]
I use custom navigation bars and everything is working greate.
My only problem is that in the views of UINavigationControllerC I placed a UIBarButton in my custom navigation bar that should link to viewA3, but I fail.
I know I can’t do this:
[self.navigationController popToRootViewControllerAnimated:YES];
Because UINavigationControllerC != UINavigationControllerA.
-
Is there a way to get the parent UINavigationController?
-
Is there a trick I could use to save UINavigationControllerA inside of UINavigationControllerC?
Thx in advance
Access
self.tabBarController.navigationControllerinstead ofself.navigationController?This may not work however as Apple explicitly state that putting a
UITabBarControllerinside aUINavigationControlleris not supported.Another option would be to access the root navigation controller from your appdelegate using something like: