This maybe what you are needing:
- (void)initTabbar {
self.tabBarController = [[UITabBarController alloc] init];
self.tabBarController.delegate = self;
/*
You want each of your UIViewControllers to be wrapped in a UINavigationController. Then put each of those UINavigationControllers in a UITabBarController
*/
//You don't need to hang on to this becuase the proceeding UINavigationController will handle it
FirstViewController *firstViewController = [[FirstViewController alloc] ...];
//You'll need to declare this in your header
self.firstNavigationController = [[UINavigationController alloc] initWithRootViewController:firstViewController];
//Second view allocation
SecondViewController *secondViewController = [[SecondViewController alloc] ...];
self.secondNavigationController = [[UINavigationController alloc] initWithRootViewController:secondViewController];
//Third view allocation
ThirdViewController *thirdViewController = [[ThirdViewController alloc] ...];
self.thirdNavigationController = [[UINavigationController alloc] initWithRootViewController:thirdViewController];
//Now you add each of the UINavigationControllers (which is a subclass of UIViewController) to the UITabBarController.
self.tabBarController.viewControllers = [NSArray arrayWithObjects:self.firstNavigationController,
self.secondNavigationController,
self.thirdNavigationController,
nil];
[self.window addSubview:self.tabBarController.view];
[self createNavs];
}
//This is more of a 'formatNavs' now
- (void)createNavs {
//Now you can customize each of the UINavigationController's UINavigationBars seperatly
self.firstNavigationController.navigationBar.backgroundColor = [UIColor colorWithHexString:@"00A3E1"];
self.firstNavigationController.navigationBar.tintColor = [UIColor colorWithHexString:@"00A3E1"];
self.firstNavigationController.navigationBar.barTintColor = [UIColor colorWithHexString:@"00A3E1"];
self.secondNavigationController.navigationBar.backgroundColor = [UIColor colorWithHexString:@"...."];
self.secondNavigationController.navigationBar.tintColor = [UIColor colorWithHexString:@"...."];
self.secondNavigationController.navigationBar.barTintColor = [UIColor colorWithHexString:@"...."];
self.thirdNavigationController.navigationBar.backgroundColor = [UIColor colorWithHexString:@"...."];
self.thirdNavigationController.navigationBar.tintColor = [UIColor colorWithHexString:@"...."];
self.thirdNavigationController.navigationBar.barTintColor = [UIColor colorWithHexString:@"...."];
}