Xcode4 在Xcode 4中更改文件类型的工作方式与在Xcode 3中相同

Xcode4 在Xcode 4中更改文件类型的工作方式与在Xcode 3中相同,xcode4,Xcode4,我刚刚安装了Xcode 4,我遇到了一个问题。我有如下代码: #ifdef __OBJC__ #include <Foundation/NSAutoReleasePool.h> #include <Foundation/NSPathUtilities.h> #include <CoreFoundation/CoreFoundation.h> #else Get GCC to error here! - Please read comment below

我刚刚安装了Xcode 4,我遇到了一个问题。我有如下代码:

#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
这段代码的目的是在Get GCC行上给您一个错误,以便您将文件类型切换到sourcode.c.objc,然后当您再次编译时,Get GCC行将不会被编译。这在Xcode 3中有效,但在Xcode 4中无效

有人对Xcode 3和4之间的文件类型设置有什么建议吗?还是定义对象发生了变化


提前谢谢。

我已通过关闭Xcode然后重新打开来修复它。现在所有的东西都编译好了,这就是我所做的