Hi there,
I am currently working on an app that uses a tab bar and in at least one of the tabs I want to use a navigation controller. My application delegate takes a UITabBarController and there is a NavRootController class which is used to control the view of the first tab. This class is going to be my navigation controller class and thus has an ivar of type UINavigationController. Now I can instantiate another viewController (say, SecondViewController) and push it to the stack by calling the pushViewController:animated: method of self.navigationController, which perfectly works. But how can I go deeper in the hierarchy, so how can I push another view from a SecondViewController instance to the stack of my navigation controller now? Without a tab bar, my application delegate would take the navigation controller and I would send my push message to delegate.naigationController like this:
Code:
TestAppDelegate *delegate = [[UIApplication sharedApplication] delegate];
[delegate.navigationController pushViewController:viewInstance animated:YES];
But in my case I need to message the (navigation-)controller of the first view of the tab bar, right? But I have no clue how to do this.
In general: Is my approach correct at all or is the navigation controller in the wrong place?
Thanks in advance!