iCreative
iCreative

Reputation: 1506

Add UITabBar to existing application

I have fully developed application. I have to implement UITabBar into the application, but not in appdelegate, but in some other view & I have to use it for all other views leaving Appdelegate & 1st view after appdelegate.

Can anybody tell me the best way 2 do it?

Any Help would be appreciated.

Upvotes: 0

Views: 227

Answers (2)

rishi
rishi

Reputation: 11839

You can use active view controller concept here, just fetch active view controller from UIApplication and perform the action.

Upvotes: 1

Manlio
Manlio

Reputation: 10865

You just need to push a UITabBarController. For example you can do something like

UITabBarController *tabController = [[UITabBarController alloc] init];

Controller1 *controller = [[Controller1 alloc] initWithNibName:@"Controller1" bundle:nil];

Controller2 *controller = [[Controller2 alloc] initWithNibName:@"Controller2" bundle:nil];

Controller3 *controller = [[Controller3 alloc] initWithNibName:@"Controller3" bundle:nil];

tabController.viewControllers = [NSArray arrayWithObjects:controller1,controller2,controller3,nil];

[controller1 release];
[controller2 release];
[controller3 release];

[self.navigationController pushViewController:tabController animated:YES];

Check the reference: UITabBarController

Upvotes: 1

Related Questions