tags:

views:

1451

answers:

3

Hi I am using iphone_sdk_3.0_beta_5__9m2735 SDK. When I try to compile my code using simulator 3.0 option I get following error. The code compiles for rest all simulator option ie 2.0, 2.1, 2.2, 2.2.1 While compiling my code I get following error

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

The errors are located in file UILocalizedIndexedCollation.h which is SDK file.I am using UIKit Framework of SDK 3.0. Can anyone tell me what should I do to remove this error?

A: 

Firstly you should discuss beta products here.

However, this is not connected with the beta. You have an error in one of your own header filesprobably a missing '@end' statment.

BTW, google could have solved this for you rather than asking here.

Roger Nolan
I will keep this in mind while posting queries.
Manish
@Roger, I think you meant we "shouldn't" discuss beta products here.
Abizern
+6  A: 

I've traced this problem to be the compiler version being used. From what I can tell, [REDACTED] requires GCC 4.2 while iPhone SDK 2.x only works with GCC 4.0.

Here's a way to fix this.

In your Target Info, select Build separator and look for the section Compiler Version. Then:

  1. Select the C/C++ Compiler Version row
  2. Set the default to GCC 4.0
  3. At the bottom-left control, hit Add Build Setting Condition
  4. On the left, choose Device - iPhone OS 3.0
  5. On the right, chose GCC 4.2
  6. Repeat steps 3 to 5, now with Simulator - iPhone OS 3.0 on step 4.
jpedroso
Hi jpedrosoI did follow the above steps but I am getting same 3 errors.
Manish
One clarification: for step 3 you need to have selected the "C/C++ Compiler Version" build setting, otherwise "Add Build Setting Condition" is greyed out. That stumped me for a bit!Once I'd done that these instructions fixed the problem for me. Manish - did you try a Clean build?
Dan J
+4  A: 

Apple’s engineer had confirmed that they had a bug in UIKit framework:

We do have a simple workaround for this UIKit bug. In UILocalizedIndexedCollation.h change this:

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

Denis2342

denis2342
This problem is only for the 3.0 SDK. Version 3.1 don't have it.
Sixto Saez
awesome, this is a royal pain in the ass, and now its fixed. thank you!
AWright4911