应用程序试图在目标<uinavigationcontroller> </uinavigationcontroller>上推送一个nil视图控制器

时间:2012-03-10 21:22:27

标签: iphone objective-c ios

我有一个UITableView,它被分配给由“ArticleNavigation”标识的NavigationController。在我的委托(didFinishLaunchingWithOptions method)中,我尝试以编程方式创建UItabBar:

main_tab =[[UITabBarController alloc] init];

viewController1 = [[ListViewController alloc]init];

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];

UINavigationController * nav1=[[storyboard instantiateViewControllerWithIdentifier:@"ArticleNavigation"]initWithRootViewController:viewController1];

tabs_array=[[NSArray alloc]initWithObjects:nav1, nil];

main_tab.viewControllers=tabs_array;

self.window.rootViewController=main_tab;

当我运行我的应用程序并单击一个单元格时,我收到此错误: Application tried to push a nil view controller on target

请猜猜?

0 个答案:

没有答案