Why coffee and iPhone development don’t mix
I’ve been having strange warning messages appear in my project every time I add a new class for quite a while now – I had hoped upgrading to XCode 4 would resolve the problem, but unfortunately it did not.
The error message that occurs is this:
[WARN]warning: no rule to process file '$(PROJECT_DIR)/Project.xcodeproj/ProjectHeader.h' of type sourcecode.objj.h for architecture i386
As it turns out, it actually was nothing to do with XCode itself, rather my choice of coffee…
Basically the compiler warning is just saying that it has been told to compile a header file, which it doesn’t know how to do. I had been manually fixing the warnings by going through my project and removing the .h files from the list of sources to be compiled.
However recently I managed to work out what was causing the problem after I realised that it wasn’t some weird XCode setting at all, but was specific to my installation. It turns out at some point in the past I had installed the Cappucino Web Framework to evaluate for a project I was working on. In the end I didn’t use it, but the installation had left some files in my XCode plugins directory. Cappucino uses Objective-J, which unfortunately also uses .h as the extension for its header files. As a result, there was a language template for Cappucino which told XCode that any .h files were in fact Objective-J header files and should be compiled. If I had been a bit more observant I probably would have noticed the tell-tale objj part of the error message earlier and twigged a lot earlier.
Since I am not using Objective-J, or Cappucino for that matter, the simple fix for me was to remove these files from the XCode plugins folder. This can be found in ~/Library/Application Support/Developer/Shared/Xcode/.