."是什么?-6ren"> ."是什么?-我的编码是 - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { FirstTabBarItem = [[FirstMu-6ren">
gpt4 book ai didi

iphone - 错误 "Application tried to push a nil view controller on target ."是什么?

转载 作者:行者123 更新时间:2023-12-03 20:56:09 24 4
gpt4 key购买 nike

我的编码是

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {

FirstTabBarItem = [[FirstMuseum alloc] init];
SecondTabBarItem = [[SecondMaps alloc] init];
ThirdTabBarItem = [[ThirdExhibition alloc] init];
FourthTabBarItem = [[FourthTabBarItem alloc] init];


first = [[UINavigationController alloc] initWithRootViewController:FirstTabBarItem];
second = [[UINavigationController alloc] initWithRootViewController:SecondTabBarItem];
third = [[UINavigationController alloc] initWithRootViewController:ThirdTabBarItem];
fourth = [[UINavigationController alloc] initWithRootViewController:FourthTabBarItem];


first.title = @"Hello";
second.title = @"Hello";
third.title = @"Hello";
fourth.title = @"Hello";

myControllerArray = [[NSMutableArray alloc] init];

[myControllerArray addObject:first];
[myControllerArray addObject:second];
[myControllerArray addObject:third];
[myControllerArray addObject:fourth];


myTabBar = [[UITabBarController alloc] init];

[myTabBar setViewControllers:myControllerArray];

localNavigationController = [[UINavigationController alloc] initWithRootViewController:myTabBar];

NSLog(@"Hello, You Tapped !"); }

什么是错误,我正在尝试制作一个包含四个项目的 UITabBarController,所以现在我应该做什么??????

最佳答案

这意味着您尝试推送的 View Controller 尚未正确分配。请检查 View Controller 的分配情况,看看它是否分配干净

关于iphone - 错误 "Application tried to push a nil view controller on target <UINavigationController: 0x498efa0>."是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5141310/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com