Iphone 是否可以从UINavigationController推送UITabbarController?
我有一个UIDABBarController,它正在加载一个UINavigationControllerIphone 是否可以从UINavigationController推送UITabbarController?,iphone,objective-c,cocoa-touch,interface-builder,uinavigationcontroller,Iphone,Objective C,Cocoa Touch,Interface Builder,Uinavigationcontroller,我有一个UIDABBarController,它正在加载一个UINavigationController 当我按下一个新的视图控制器时,是否可以将UIAbbarController更改为一组新的选项卡?当然,为什么不将新UIViewController的数组重新指定给UIAbbarController的viewControllers属性?那就行了 - (void)addNewControllers { NSMutableArray *controllers = [NSMutableArr
当我按下一个新的视图控制器时,是否可以将UIAbbarController更改为一组新的选项卡?当然,为什么不将新UIViewController的数组重新指定给UIAbbarController的viewControllers属性?那就行了
- (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];
}
阅读更多关于潜在副作用的信息。我不确定是否遵循。你能给我发一个链接或提供示例代码吗?当然-我用一些代码编辑了我的回复,以供查看。