我想解决iOS7中statusBar
的问题。我找到了this post,这个解决方案在Xcode 5中运行得很好。但是当我在Xcode 4.6.3中尝试这个代码时,我遇到了2个错误:
No visible @interface for 'MyController' declares the selector
'setNeedsStatusBarAppearanceUpdate'
; Use of undeclared identifier
'UIStatusBarStyleLightContent'
。使用此代码解决了第一个问题:[self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)];
但我无法解决第二个错误。
答案 0 :(得分:12)
这些是iOS 7的功能,无法在XCode 4.6.3中编译,它试图针对iOS 6进行编译。您需要有条件地将它们编译出来。
用以下内容包装有问题的代码:
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
//iOS 7 only stuff here
#endif