我是 iPhone 应用程序开发的新手。
运行项目时出现此错误
Terminating app due to uncaught exception 'NSUnknownKeyException',
reason: '[<AboutViewController 0x91cc1d0> setValue:forUndefinedKey:]:
当我尝试导航到另一个名为AboutViewController
.
我这样rightBarButton
定义
UIBarButtonItem *anotherButton = [[UIBarButtonItem alloc] initWithTitle:@"About" style:UIBarButtonItemStylePlain target:self :@selector(showAbout)];
self.navigationItem.rightBarButtonItem = anotherButton;
方法showAbout
是
- (void)showAbout{
AboutViewController *abvController = [[AboutViewController alloc] initWithNibName:@"AboutViewController" bundle:nil];
[self.navigationController pushViewController:abvController animated:YES];
[abvController release];
}
此外,当我尝试使用presentModelViewController
而不是navigationController
,编译器显示它已被弃用。