我试图在我的 tabbarcontroller 的第三个选项卡中包含一个导航控制器。我有一些反馈,但我只能做到这一点。下面的代码不会产生任何错误,但似乎无法正常工作,因为应用程序刚刚退出。有人对我可能做错的事情有任何意见吗?
UIViewController *viewController1 = [[FirstViewController alloc]
initWithNibName:@"PDCFirstViewController" bundle:nil];
UIViewController *viewController2 = [[SecondViewController alloc]
initWithNibName:@"SecondViewController" bundle:nil];
viewController3 = [[UIViewController alloc] initWithNibName:@"ThirdViewController"
bundle:nil];
UINavigationController *navigationcontroller = [[UINavigationController alloc]
initWithRootViewController:viewController3];
self.tabBarController = [[UITabBarController alloc] init];
self.tabBarController.viewControllers = [NSArray
arrayWithObjects:viewController1,viewController2,navigationcontroller, nil];
谢谢你们!
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([PDCAppDelegate class]));
}
}