basically it happens at the line like #import and every other ios header, like UIAccelerometer is unavailable and even UIView is unavailable, the compile stopped at the line #import. what could cause that?
3 回答
I just had this issue trying to build for iOS 5.1 in XCode 4.5 after manually installing the iOS 5.1 SDK out of XCode 4.4.
After some initial frustration, this solved the issue: Xcode 4.5 and iOS 4.2.1 incompatibility
Find your .xcodeproj, do "Show Package Contents" to expose your .pbproj and open it in a plaintext editor ( or Komodo Edit, maybe TextEdit if you have it setup to use plain text by default). Find every instance "IPHONEOS_DEPLOYMENT_TARGET" and make sure it says "IPHONEOS_DEPLOYMENT_TARGET = 4.0;"
Having the SDK 5.1 installed alone isn't enough, as I have discovered. Nor is changing the Deployment Target field under "Info". I had to manually edit the .pbxproj
Either you are building for MacOSX by accident, or you need to add the frameworks you are importing form iOS into your project.
faced similar compiling issues with xcode 5 using base sdk 6.3 - turned out to be several xib had a value of "opens in Default(5.0)". Setting the value to "opens in XCode 4.6" fixed it