重新安装UIKit和Foundation框架后找不到iOS SDK

Mat*_*ell 4 iphone objective-c ios4 ios iad

对于pch文件,我收到以下错误:

/Users/matt/Programming/iPhone Monkey Curling lite/iPhone_Monkey_Curling_Prefix.pch:6:34: error: Foundation/Foundation.h: No such file or directory
/Users/matt/Programming/iPhone Monkey Curling lite/iPhone_Monkey_Curling_Prefix.pch:7:24: error: UIKit/UIKit.h: No such file or directory
Run Code Online (Sandbox Code Playgroud)

这是默认情况下的文件.

//
// Prefix header for all source files of the 'iPhone Monkey Curling' target in the 'iPhone Monkey Curling' project
//

#ifdef __OBJC__
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#endif
Run Code Online (Sandbox Code Playgroud)

我重新安装了xcode和iOS SDK,但没有解决问题.将iAd框架添加到我的某个项目后发生此问题,但我的所有项目都不会编译.

我正在使用最新的SDK(4.1).

框架在项目中.出于某种原因,当我尝试添加新框架时,它会在iOS项目中列出OSX.

感谢您的任何帮助.

Mat*_*ell 13

在Apple开发者论坛上,我设法获得了针对这个问题的帮助.事实证明,构建选项设置为奇怪的东西.

这是"框架搜索路径"选项.如果有人遇到类似的问题,请确保这是空的.


Yur*_*yev 5

我想补充马修的答案:

实际上,框架搜索路径不应该为空,但它应该只包含SDK的Frameworks文件夹的路径.在我的情况下,模拟器使用此路径:

/Applications/Xcode.app/Contents/Developer/Platforms/_**iPhoneSimulator.platform**_/Developer/SDKs/iPhoneOS6.0.sdk/System/Library/Frameworks/
Run Code Online (Sandbox Code Playgroud)

当我添加这个时,设备开始工作:

/Applications/Xcode.app/Contents/Developer/Platforms/_**iPhoneOS.platform**_/Developer/SDKs/iPhoneOS6.0.sdk/System/Library/Frameworks/
Run Code Online (Sandbox Code Playgroud)

这是针对XCode版本4.5.1(4G1004).