I have a UITabBarController that is loading a UINavigationController.
When I push a new view controller, is it possible to change the UITabBarController to a new set of tabs?
I have a UITabBarController that is loading a UINavigationController.
When I push a new view controller, is it possible to change the UITabBarController to a new set of tabs?
Sure, why not just re-assign your new UIViewController's array to UITabBarController's viewControllers property? That will do the trick.
- (void)addNewControllers {
NSMutableArray *controllers = [NSMutableArray array];
UIViewController *c0 = [[[UIViewController alloc] init] autorelease];
[controllers addObject: c0];
UIViewController *c1 = [[[UIViewController alloc] init] autorelease];
[controllers addObject: c1];
UIViewController *c2 = [[[UIViewController alloc] init] autorelease];
[controllers addObject: c2];
[myTabBarController setViewControllers:controllers];
}
Read more about the potential side effects here.