lostintranslation
lostintranslation

Reputation: 24583

Tabbed application (template), need one controller to have a static table view

I just created a new xcode project with the 'Tabbed Application' template. I have a tabbed application with two tabs therefore two controllers. Both controllers are of type UIViewController. I made one of my controllers the 'settings' controller. I added a nav bar with a title of 'Settings'. All is well so far.

Then I add a TableView to the settings controller and make it a static table. Apparently I cannot have a static table view inside of a normal ViewController, it needs to live in a TableViewController.

Here is where I get very lost (still very new to iOS programming).

  1. Am I supposed to delete the ViewController that the template provided and add a new TableViewController? I tried this however I cannot add a navbar to this type of controller.

  2. Or is there some way to shove a TableViewController into the ViewController to get things to work.

I have looked all over today and most examples of TableViewControllers I have found are not in a tabbed application so they just create a TableViewController and move on.

Oh I also need to be compatible with iOS 5. Not sure if that makes a difference with TableViewController stuff.

Any help would be greatly appreciated.

Thanks.

Update: other option: you can follow this tutorial too.

Upvotes: 0

Views: 168

Answers (1)

Marioea
Marioea

Reputation: 201

Yes, of course you can:

  1. Delete de UIViewController
  2. Add to your storyborad a new TableViewController
  3. Select it and go to Editor Menu->Embed In->Navigation Controller
  4. Connect it to your tabbar in the storyboard

Update: other option: you can follow this tutorial too: Tutorial: Storyboard in XCode 4.2 with Navigation Controller and Tabbar Controller (Part 1)

Hope it helps!

Upvotes: 1

Related Questions