There actually are no good tutorials that explain this relatively simple thing in simple enough terms. One seemingly popular tutorial include an insane amount of work and suggest subclassing almost everything. I figured I'd just write down the required steps here. Let me know if this isn't clear enough.
1) Create a new Tab bar based project.
2) For this exercise we will replace the second tab with a navigation controller. So delete:
SecondViewController.h
SecondViewController.m
SecondView.xib
3) Right click your project > New File. Select UIViewController Subclass > Subclass of UITableViewController. (Select to include XIB for interface).
* I'm not a fan of UITableViewController, in most cases you're better off using a UIViewController with a UITableView but that's a different discussion.
4) Select MainWindow.xib so that IB opens. Make sure to show the Utilities View (on the right hand side).
5) Expand the Tab Bar Controller object under Objects. Delete the 'Second View Controller'.
6) Drag a Navigation Controller from the Objects on the Utility View and drop it onto the Tab Bar Controller on the same level as the 'First View Controller'.
7) Expand your new Navigation Controller and select 'View Controller'
8) Go to the Identity inspector and under Custom Class change the Class to the name of the class you created in step 3.
9) Show the attributes inspector and set the NIB Name to the same name.
10) Enjoy the fruits of your labour.
|