A sample project showing a UINavigationController inside a UITabBarController
Step by Step
- Create new project from Tab Bar Application template.
- Add new Class to your project that is a UITableViewController delegate (right click->New File -> UIViewController template -> pick Sublcass of: UITableViewController) Name it 'NavigationRoot' or something
- Click on MainWindow.xib, and get into the expanded left view so you can drill down into things.
- Expand the Tab Bar Controller so you can see the Tab Bar and the two View Controller objects in there (First View Controller and Second View Controller)
- From the Library, drag in a Navigation Controller and nest it inside the Tab Bar Controller in-between the existing ones or before or after them: choose your own adventure! (you can delete either or both of the "stock" ones if you want.)
- You will see a second view looking thing pop up in your editor. Do not panic, this is fine.
- Expand the NAvigation Controller you just added
- Click on the View Controller - Root View Controller, and in the inspector, change the class to NavigationRoot.
- Edit your NavigationRoot.m file to give your table a row with some witty text.
- Run your project in the simulator. Hooray!
- Add another view controller, and edit your NavigationRoot.m to push it when you select your witty text row. (I am glossing over this step since I'm guessnig you know how to do it.)
- Run your project again!