我是iPhone App开发的新手。因未捕获异常'NSUnknownKeyException'而终止应用,原因:'[<AboutViewController 0x91cc1d0> setValue:forUndefinedKey:]:
,当我跑我的项目
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
,编译器显示它已被弃用。
的文档(http://developer.apple.com/library/ios/ #文档/ UIKit的/参照/ UIViewController_Class/DeprecationAppendix/AppendixADeprecatedAPI.html#// apple_ref/OCC/instm/UIViewController中/ presentModalViewController:ANI配合:)告诉你使用presentViewController:动画:完成: –
@michele:谢谢 – nbs