1

On my firstViewController I have a tabbar that contains my firstViewController and a helpViewController.

When I click on a button from the FirstViewController, I push a NewViewController. But, when this view is pushed, I want to change the content from the TabBarController to display other ViewControllers, like infoViewController, optionViewController and NewViewController. Is that possible?

The First Image represents my application. The FirstViewController has a button that will push the NewViewController. When the user clicks this button, I want that my app shows what is in the second image. Is possible?My problem

1 Answers1

1

You should only have 1 UITabBarController in a project, and it should be your rootViewController. If you want different tabs then you should explore setViewControllers:animated:.

Michael Kernahan
  • 1,442
  • 1
  • 13
  • 15
  • But how do I change the tabs that will appear on the 'UITabBarController'? I mean, what code I should put on my 'NewViewController'? – Felipe Boszczowski Nov 15 '12 at 15:31
  • each `UIViewController` is responsible for providing his tab. So when you set the viewControllers, the tabs will fill in. Your question is very unclear with regards to `FirstViewController` and `NewViewController`. Are they in a `UINavigationController` and you basically want `FirstViewController` to push to the `UITabBarController` with `NewViewController` as the first view? – Michael Kernahan Nov 15 '12 at 17:38
  • I have as rootViewController the `FirstViewController`. This view has a `NavigationController` and a `TabBarController` showing itself and a HelpViewController. When I click on a button, the app push the `NewViewController`. On this ViewController, I want to change the `TabBarController` to show itself, `InfoViewController` and `optionsViewController`. – Felipe Boszczowski Nov 15 '12 at 18:50
  • I'm sorry but I don't understand. `UITabBarController` should be your root object if you have one, it should not be embedded in a `UINavigationController`. It sounds like you want a `UINavigationController` that contains two `UITabBarController` view Controllers, each with their own tabs. Pushing from one `VC` to another but stating that they have the same `TabBarController` doesn't make any sense to me. Sorry. – Michael Kernahan Nov 15 '12 at 19:11