0

I have a navigation application with 3 views, in my second view, I want add a tarbarcontroller and control another two views, how can I do that?

VMAtm
  • 27,943
  • 17
  • 79
  • 125
ddzcoeur
  • 26
  • 2

2 Answers2

1

Let's say you have a tabBarController include two tabs:controller1 & controller1, push it whenever you want.

UITabBarController * tabBarController = [[UITabBarController alloc] init];
UIViewController * controller1 = [[UIViewController alloc] init];
UIViewController * controller2 = [[UIViewController alloc] init];
tabBarController.viewControllers = [NSArray arrayWithObjects:controller1, controller2 nil];
[controller1 release];
[controller2 release];
[self.navigationController pushViewController:tabBarController animated:YES];
[tabBarController release];
Kjuly
  • 34,476
  • 22
  • 104
  • 118
0

Allocate a new Tab controller and attach it as a subview to your nav controller in that view.

DogEatDog
  • 2,899
  • 2
  • 36
  • 65