0

在我通过 SVN 更新我的工作副本后,我遇到了一些错误。

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSCharacterSet.h:8:0 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSCharacterSet.h:8:32: error: Foundation/NSString.h: No such file or directory

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSCharacterSet.h:45:0 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSCharacterSet.h:45: error: expected ')' before 'unichar'

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSPathUtilities.h:10:0 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSPathUtilities.h:10: error: cannot find interface declaration for 'NSString'

所有这些错误都表明编译器无法在 Foundation 框架中找到 NSString.h 文件,我在 Xcode/Frameworks/Foundation.framework/Headers 中打开了 Foundation 框架,并注意到那里没有 NSString 头文件。谁能告诉我发生了什么?我试图删除框架并再次添加它,但它失败了。我仍然没有 NSString 头文件。

4

2 回答 2

0

尝试再次安装 XCode。不再支持较旧的 SDK 版本。选择 SDK 4.2 并重新编译。(我复制了 SDK 4.0 以实现向后兼容性,但它没有显示在目标和项目设置中)

于 2010-12-21T08:52:10.320 回答
0

我在一个从 XCode 3 开始,现在在 XCode 4 中编译的项目中遇到了这个问题,其中行

 -#include <Foundation/NSString.h>

被标记为没有这样的文件。我通过重新添加框架来修复它 - 尽管它已经出现在我的项目中(从我在 XCode 3 中添加它时)使用这种方法:

如何在 Xcode 4 中“添加现有框架”?

我注意到使用这种方法看到的列表包括 Foundation 框架。

于 2011-06-25T06:22:50.497 回答