Ios 尝试显示ViewController后出现奇怪错误
我有一个ViewController,它被加载到选项卡栏中 在显示整个内容时,程序接收到Ios 尝试显示ViewController后出现奇怪错误,ios,ios5,uitabbarcontroller,Ios,Ios5,Uitabbarcontroller,我有一个ViewController,它被加载到选项卡栏中 在显示整个内容时,程序接收到SIGABRT,并给我留下以下错误: 2012-03-01 21:53:21.118 GameControl[78897:207]***由于未捕获的异常“NSUnknownKeyException”而终止应用程序,原因:“[setValue:forUndefinedKey:]:此类不符合密钥单例的键值编码。 有人知道这意味着什么吗 下面是我设置视图的代码: RootViewController *rootC
SIGABRT
,并给我留下以下错误:
2012-03-01 21:53:21.118 GameControl[78897:207]***由于未捕获的异常“NSUnknownKeyException”而终止应用程序,原因:“[setValue:forUndefinedKey:]:此类不符合密钥单例的键值编码。
有人知道这意味着什么吗
下面是我设置视图的代码:
RootViewController *rootController = [[RootViewController alloc] initWithNibName:@"RootViewController" bundle:nil];
FavoriteViewController *favoriteController = [[FavoriteViewController alloc] initWithNibName:@"FavoriteViewController" bundle:nil];
rootController.xmlData = self.xmlData;
favoriteController.xmlData = self.xmlData;
navigationController = [[UINavigationController alloc] initWithRootViewController:rootController];
tabBarController = [[UITabBarController alloc] init];
navigationController.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Root" image:nil tag:0];
favoriteController.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Favorites" image:nil tag:0];
tabBarController.viewControllers = [NSArray arrayWithObjects:navigationController, favoriteController, nil];
if ([[self.window subviews] count] != 0) {
[[[self.window subviews] objectAtIndex:0] removeFromSuperview];
}
[self.window addSubview:tabBarController.view];
我使用的是IOS5,带有ARC,但没有故事板
谢谢 您正在尝试访问favoriteviewcontroller上的属性singleton。可能您的nib文件中有一个旧链接?看起来您没有将favoriteController添加到选项卡栏控制器或其他任何地方。这是故意的吗?我为了测试的原因改变了这个。。。我会编辑的。谢谢,没错;)找到了那个邪恶的笔尖文件。