我挣扎编译iPad应用程序上使用的iOS 6和iOS 7编译,在iOS 6中和iOS 7的作品
这是我不断收到消息的应用程序:
Property 'barTintColor' not found on object of type 'UITabBar *'; did you mean 'tintColor'?
目标的Base SDK
设置为Latest iOS (iOS 7.0)
,iOS Deployment Target
为iOS 6.0
。我在这个项目上做了一个清洁工。
下面是代码:
在.h文件:
@property (nonatomic, strong) IBOutlet UITabBar *tabbedBar;
在.m文件:
if ([tabbedBar respondsToSelector: @selector(barTintColor)]) {
tabbedBar.barTintColor = [UIColor blackColor];
}
我编译反对iOS 7 SDK,所以它应该知道barTintColor。任何想法可能是什么问题?
更新时间:
好吧,我在进步,但不是很理解为什么。
看到这个Xcode截图。在Active Scheme选项中记下我的iPad 3的两个条目。有什么不同?如果我选择最上面的选项,我会看到错误。如果我选择底部选项,它可以工作。
谁能解释为什么同样的设备在此列表中出现两次,为什么当我选择一个,而不是其他的工作?仅供参考,该设备安装了iOS 6。
这是一个运行时还是编译错误?你可以试试'@selector(setBarTintColor:)'? –
您是否尝试过选择器setBarTintColor:?如[tabbedBar setBarTintColor:[UIColor blackColor]]; – CSmith
对不起,Xcode也不知道'setBarTintColor'。看到这个截图[链接](http://i.imgur.com/kN0Qu7N.png) – Axeva