UIKit SDK 3.0错误

问题描述:

我正在使用iphone_sdk_3.0_beta_5__9m2735 SDK。 当我尝试使用模拟器3.0选项编译我的代码时,出现以下错误。代码编译为其余全部模拟器选项,也就是2.0,2.1,2.2,2.2.1 在编写我的代码,我得到以下错误UIKit SDK 3.0错误

 
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 file.I上午使用SDK 3.0的UIKit框架。任何人都可以告诉我该怎么做才能消除此错误?

首先,您应该在这里讨论测试产品。

但是,这与测试版没有关联。你在你自己的头文件中有一个错误,可能是缺少一个'@end'语句。

顺便说一句,谷歌可以为你解决这个问题,而不是问这里。

+0

同时发布查询,我会记住这一点。 – Manish 2009-05-29 08:50:03

+0

@Roger,我认为你的意思是我们“不应该”在这里讨论beta产品。 – Abizern 2009-05-29 17:21:39

我追查到这个问题是正在使用的编译器版本。据我所知,[编辑]需要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,现在用步骤4中的Simulator - iPhone OS 3.0
+0

嗨jpedroso 我没有按照上述步骤,但我得到相同的3个错误。 – Manish 2009-06-15 09:20:22

苹果公司的工程师证实,他们在UIKit框架中的错误:

我们确实有这个错误的UIKit一个简单的解决方法。在UILocalizedIndexedCollat​​ion.h更改此:

UIKIT_EXTERN @interface UILocalizedIndexedCollation : NSObject 
to 
UIKIT_EXTERN_CLASS @interface UILocalizedIndexedCollation : NSObject 

Denis2342