我在使用 CLANG 构建代码时遇到了这个错误:
在 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:31 包含的文件中, 来自 /Users/waspfish/Documents/NanaimoStudio/Projects/iPhoneMonk/Projects/IdeaOrganizer/IdeaOrganizer_Prefix.pch:13, 从:1: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILocalizedIndexedCollation.h:13:错误:'AT_NAME'标记之前的语法错误 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILocalizedIndexedCollation.h:21:错误:'}'标记之前的语法错误 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILocalizedIndexedCollation.h:23:致命错误:方法定义不在@implementation上下文中 编译终止。 {标准输入}:32:FATAL:.abort 检测到。组装停止。
我最终不得不从 UIKit.h 中排除 UILocalizedIndexedCollation.h 并且一切正常。知道是什么导致了这个问题吗?我无法想象 Apple 会发送有缺陷的头文件。