Reputation: 26
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?
Upvotes: 0
Views: 156
Reputation: 35181
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];
Upvotes: 1
Reputation: 3047
Allocate a new Tab controller and attach it as a subview to your nav controller in that view.
Upvotes: 0