UIKit SDK 3.0错误

Man*_*ish 3 iphone uikit

我使用的是iphone_sdk_3.0_beta_5__9m2735 SDK.当我尝试使用模拟器3.0选项编译我的代码时,我得到以下错误.代码编译为休息所有模拟器选项,即2.0,2.1,2.2,2.2.1编译我的代码时,我得到以下错误

from /Users/videomac/manish/EXPLab/2009-05-27-11-20 myApp_LL_2/myApp_Prefix.pch:7:
In file included from /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:30,
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILocalizedIndexedCollation.h:11: error: syntax error before 'AT_NAME' token
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILocalizedIndexedCollation.h:19: error: syntax error before '}' token
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILocalizedIndexedCollation.h:21: fatal error: method definition not in @implementation context

错误位于文件UILocalizedIndexedCollat​​ion.h,这是SDK文件.我正在使用SDK 3.0的UIKit Framework.任何人都可以告诉我该怎么做才能删除此错误?

小智 6

我已经将此问题描述为正在使用的编译器版本.据我所知,[删除]需要GCC 4.2,而iPhone SDK 2.x仅适用于GCC 4.0.

这是一种解决这个问题的方法.

在您的Target Info,选择Build分隔符并查找该部分Compiler Version.然后:

  1. 选择C/C++ Compiler Version
  2. 将默认值设置为 GCC 4.0
  3. 在左下角的控件中,点击 Add Build Setting Condition
  4. 在左侧,选择 Device - iPhone OS 3.0
  5. 在右边,选择 GCC 4.2
  6. 重复步骤3到5,现在执行Simulator - iPhone OS 3.0步骤4.