2009-05-28 73 views
3

我正在使用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框架。任何人都可以告訴我該怎麼做才能消除此錯誤?

回答

0

首先,您應該在這裏討論測試產品。

但是,這與測試版沒有關聯。你在你自己的頭文件中有一個錯誤,可能是缺少一個'@end'語句。

順便說一句,谷歌可以爲你解決這個問題,而不是問這裏。

+0

同時發佈查詢,我會記住這一點。 – Manish 2009-05-29 08:50:03

+0

@Roger,我認爲你的意思是我們「不應該」在這裏討論beta產品。 – Abizern 2009-05-29 17:21:39

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,現在用步驟4中的Simulator - iPhone OS 3.0
+0

嗨jpedroso 我沒有按照上述步驟,但我得到相同的3個錯誤。 – Manish 2009-06-15 09:20:22

4

蘋果公司的工程師證實,他們在UIKit框架中的錯誤:

我們確實有這個錯誤的UIKit一個簡單的解決方法。在UILocalizedIndexedCollat​​ion.h更改此:

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

Denis2342