我有一个自定义的UITabBarController。在它上面我添加了3个视图控制器,首先为每个控制器添加一个navigationController。看起来像这样
·customTabBarController.m viewDidLoad:
- (void)viewDidLoad
{
[super viewDidLoad];
FirstViewController *firstController = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil];
UINavigationController *firstNavController = [[UINavigationController alloc] initWithRootViewController:firstController];
SecondViewController *secondController = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil];
UINavigationController *secondNavController = [[UINavigationController alloc] initWithRootViewController:secondController];
self.viewControllers = [NSArray arrayWithObjects:firstNavController, secondNavController, nil];
[self addLeftButtonImage];
[self addRightButtonImage];
self.selectedIndex = 1;
}
现在,当我在视图控制器上并且我想要pushViewController时,我该如何调用它?