3
votes

What is the logic or view structure of an app with a tab bar, e.g. 3 different tabs. Each tab having a navigation controller inside the tab viewcontroller tabs?

Where are the navigation controllers created and managed?

3

3 Answers

10
votes

If you're using NIB files, you can set up the structure of your app right in your main NIB. The structure looks like this:

  • UITabViewController
    • UINavigationViewController
      • TabBarItem
      • UIViewController (set to load from Tab 1 View.nib)
        • NavigationItem (for root view of tab 1's nav controller)
    • UINavigationViewController
      • TabBarItem
      • UIViewController (set to load from Tab 2 View.nib)
        • NavigationItem
    • UINavigationViewController
      • TabBarItem
      • UIViewController (set to load from Tab 3 View.nib)
        • NavigationItem
3
votes

This was driving me nuts too so once I got it working I added this:

https://github.com/benbruscella/iPhone-TabBarController-With-NavigationController

Hopefully this will help someone.

1
votes

From the main xib you can set the navigation controllers from there you can set the classes to be uploaded on that navigation controllers......