【发布时间】:2011-11-21 11:43:09
【问题描述】:
在我的应用程序中,我想在导航栏中的后退按钮一起显示一个按钮项。我阅读了UINavigationItem 类的文档,发现leftItemsSupplementBackButton 似乎只适合我。然后我用了这行代码:
- (void)viewDidLoad{
[super viewDidLoad];
[self.navigationItem setLeftItemsSupplementBackButton:YES];
}
但是当我运行应用程序时,我得到了这个错误:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UINavigationItem setLeftItemsSupplementBackButton:]: unrecognized selector sent to instance 0x10faefb0'
而 0x10faefb0 实例是:
_navigationItem UINavigationItem * 0x10faefb0
从错误看来self.navigationItem 没有the apple class reference 中所说的这个属性。我哪里错了?
【问题讨论】:
-
您的 plist 中的目标 iOS 版本是什么?
-
我知道你的意思,我现在在参考类中看到这个属性在iOS 5.0 及更高版本中可用,我的ios 目标是4.3。
标签: objective-c ios uinavigationcontroller uinavigationitem