views:

69

answers:

1

Hey guys,

I made a new Console Application Project in XCode, and in the main.c file, I tried to Import Cocoa.h and another header file that I made. However, XCode started freaking out and gave me a bunch of errors. All of the errors were Parse Issues and came from NSObjCRuntime.h, NSZone.h, and NSObject.h. Anyone know why? Thanks!

+2  A: 

Because .c is for C files; .m is for Objective-C files.

By calling your file main.c, you told Xcode to compile the file as C. As it includes Objective-C headers, it obviously meets parsing errors. Change the extension to .m and you'll be fine.

zneak
Oh man, I didn't even realize that the file was .c and not .m. THANKS!
hassaanm