xcode “compile source as” override for specific fi

2019-05-11 19:57发布

问题:

I have a project that has to be set to "Objective-C++" for the "compile source as" value (no, "according to file type" will not work in my main project). I am having a problem with a file I got from a framework (specifically OpenFeint) that has compile errors when compiled as "Objective-C++".

error: pointer of type 'void *' used in arithmetic

I can get the file to compile in a test project that is set to "according to file type" for the "compile source as" value. So I am wondering how to set a specific file to compile as Objective-C? If I can get this one file to compile as Objective-C in my real project, everything should work in perfect harmony.

Any help is appreciated.

Thanks!

回答1:

Right-click the file in the Groups and Files list in Xcode, and select Get Info from the contextual menu.

You can then change the type of the file in the General tab of the info window. You probably want the file to be of type sourcecode.c.objc.



回答2:

The developer of OpenFeint got back to me and got me a pre-release of their next release. it fixes this problem.

I might add that they where very responsive.