info[at]theconspiracynyc.com
echodesignlab | bytedissident | wheresyourmachine | projects | theory | tutorials | 
HOME
WORK
CLIENTS
SERVICES
IOO
COMPANY INFO
CONTACT
PRODUCTS
GUIDELINES
 

Setting up a Tab Bar App, Part 1

March 08, 2011 03:45 pm
Posted By: bytedissident

Setting up a Tab Bar Application in XCode is a really easy process once you get the steps down.  Below is a quick step by step on how to do it.

Step 1
In XCode create a new project
Choose “Tab Bar Application” from the template that Apple provides you with.

Step2
In your “Resources” folder double click on your MainWindow.xib file to view it in Interface Builder

Step 3

When IB is open view your Document (Apple 0). Look in your document and Highlight the Tab Bar Controller View the Tab Bar Controller in your Attributes Inspector (Apple 1). Here you can add as many View Controllers as you would like by pressing the + symbol under the Tab Bar Controller Palette. To Change the Titles that appear in your tab bar buttons simply change the titles here.

a-tb

Step 4

Now you will need to create View Controller and XIB file for each ViewClick File->New File. From your templates choose Cocoa Touch Class->UIViewControllerSubClass. Then name this logically according to your apps navigation. Note: If you check “With XIB interface” XCode will automatically and connect it. I am going to do this by hand.

Step 5

For each XIB(view) you will need to connect its corresponding view controller class. To do this open each XIB in Interface Builder. Navigate to the document window (Apple 0). The hight light the “files owner” and in the attributes inspector add your view controller class under “Class Identity”.

1-tb

Step 6

Then don’t forget to connect your view to your file’s owner like so. If you do not connect your main view your app will crash.

3

Step 7

Finally your MainWindow.xib you will need to set the Nib name in your attributes inspector.

4

That should do it! happy coding.