If this helped you, please consider downloading my FREE iPhone app "Hydrate Yourself"and leaving a review.
There are a whole bunch of tutorials to create a Navigation Controller inside a TabBarController with XCode3. But there are a number of small changes in XCode4 which can trip up someone not familiar with them. So this guide is essentially an updated version of those other guides, designed to create the same simple demo using the new tool.
1. Create a new Project
We are going to start with a Tab Bar Application, so go ahead and create a new project as usual. I'm calling mine Navigation Tab Bar.
2. Select the Tab Bar
Click MainWindow.xib and you should see the integrated Interface Builder. On the left is a section called Objects, select the Tab Bar Controller.
3. Add the Navigation Controller
On the right side of your screen click the Utilities box. This is new in XCode4 and should look familiar if you've been using XCode3. At the bottom find the Navigation Controller and drag it into the Tab Bar in the middle of your screen.
Be sure to select With XIB for user interface |
Use the same file name as you used before. |
This is the simplest pushViewController line I could come up with |
Next you link the button to the new IBAction by right clicking the button and dragging the arrow to File's Owner, in the Placeholders section. Select buttonPushView.