user292049
user292049

Reputation: 1138

TabBar hides when calling a UIViewController

I am new to iPhone programming.

Current Setup: I have a TabBar Controller (4 TabBarItems). When you click on the secondTabBarOtem, it calls a second.xib which is of type UIViewController.

My Requirement: I have a button inside the view. So when I click the button, it should load another UIViewController with the TabBar visible.

Problem: I am able to do so, but the TabBar disappears and I need to restart the application to see the TabBar again.

Upvotes: 2

Views: 1309

Answers (2)

Plamen Dragozov
Plamen Dragozov

Reputation: 314

First you'll have to read and understand how UITabBarController works. Once you've set up your tabs using setViewControllers:animated: use selectedViewController to switch between them.

Upvotes: 1

Sorin Antohi
Sorin Antohi

Reputation: 6135

You should have the tab bar controller as the root and then launch navigation controllers when the various tabs are selected. doing it like this will resolve the problem of the dissapearing tab bar when pushing a new view controller.

here's a video tutorial link text that shows what you want to do. hope it helps.

Upvotes: 1

Related Questions