Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a Table View Controller to a tab based application Xcode 4.3.3

So I initially started with the tab-based application template for iOS 5. I've got a tab bar hooked up to two views, but when I go to add a Table View Controller to the firstviewcontroller, It won't let me.

I'm a little confused on how I should tackle this? Do I have to do it with code? Or is there a way I can graphically do this? enter image description here

like image 210
khaliq Avatar asked Jun 18 '12 02:06

khaliq


1 Answers

View embedding in Storyboards isn't straightforward.

First, delete First View Controller:

Storyboard without First View Controller

Now, drag a new Table View Controller onto the storyboard:

Storyboard with Table View Controller

Finally, create a relationship between Tab Bar Controller and the new Table View Controller.

Select the Tab Bar Controller and then while pressing the Control key, drag your mouse over to the Table View Controller and let go with your mouse. In the popup box, select Relationship - View Controllers

enter image description here

And now the new Table View Controller should be a tab within the original Tab Bar Controller.

enter image description here

like image 161
mopsled Avatar answered Nov 02 '22 17:11

mopsled