views:

359

answers:

2

I apparently changed something in an iPhone Xcode project, and now when it precompiles the headers I'm getting

In file included from [...] /Foundation.framework/Headers/Foundation.h:8,
                 from [...] /UIKit.framework/Headers/UIAccelerometer.h:8,
                 from [...] /UIKit.framework/Headers/UIKit.h:9:
/Developer/Platforms/[...]/NSObjCRuntime.h:146: error: stray '@' in program
/Developer/Platforms/[...]/NSObjCRuntime.h:146: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'NSString'

and then 5800 more errors...

I'm hoping somebody else did this to themselves recently and can point me in the right direction!

+4  A: 

GIYF:

http://forums.macrumors.com/archive/index.php/t-711554.html

cdespinosa
well, I'd found that myself earlier, but I knew I hadn't changed the "compile source as" setting... So setting it to "Objective-C" instead of "based on file type" did indeed work, but I'm still mystified as to why I would have had to make this change. Thanks for forcing me to take a second look!
David Maymudes
+1  A: 

As cdespinosa linked, you're compiling Objective-C as regular C++.

Go into the project settings and change the "Compile Sources As" to Objective-C++

SLaks
so what could I have done accidentally to convince XCode to start compiling my .pch file as C instead of Objective-C?
David Maymudes
I don't know; I know nothing about XCode.
SLaks