I just installed Xcode 4 and I have an issue. I have code like the following:
#ifdef __OBJC__
#include <Foundation/NSAutoReleasePool.h>
#include <Foundation/NSPathUtilities.h>
#include <CoreFoundation/CoreFoundation.h>
#else
Get GCC to error here! - Please read comment below
// You must tell Xcode to compile this filename.c as Objective-C"
// Select the file, Command-I, select "sourcecode.c.objc" from the File Type: drop list.
// Also add Foundation.framework as a dependency
#endif
This code is meant to give you an error on the Get GCC line so that you switch your File Type to sourcode.c.objc, and then when you compile again the Get GCC line won’t be compiled. This worked in Xcode 3 but not in Xcode 4.
Does anybody have any suggestions of what changed between Xcode 3 and 4 for setting File Types? Or is did the define _OBJC change?
Thanks in advance.
I have fixed it by closing Xcode and then re-opening it. Everything finally compiles now and that is all I did.