When I start a new project in XCode, it always sort of bugs me that so many things are tossed into the main project directory. I suspect I’m not alone there. To resolve that, one of the first things that I do is start organizing stuff. Two folders immediately get created: “resources” and “src”. I throw Info.plist and the English.lproj bits into resources and main.m and the precompiled headers into src. No big deal, right? Well, sorta.
As soon as you do this the XCode project will whine a bit at you (whining in this case takes for the form of the files in the project browser getting listed in red).
This part is very easily to resolve – just click on them and choose Get Info. Once you’ve got that up, click on the “Choose…” button and you’ll get a standard file navigation window. Just click into the directory you’ve stashed the file into and select it.
This all worked great for me and I thought I had everything settled there until I tried to build… and damn, it didn’t work. The message I got back (after a little quick digging into the build results window) was error: The file â€œInfo.plistâ€ does not exist.
Damned annoying message, because I know it exists – I just moved it.
The resolution to it really isn’t that bad, but it can be confusing. There is a build configuration “Info.plist File” that you can set. But where you really want to set it is on the target, not the project. Turns out you can set it in both places, and when I set it in just the project, it didn’t fix the problem. To resolve, find your build target and choose “Get Info” there. Click on the “build” tab and find the configuration setting (the built in search mechanism is a joy here).
You’ll see in the above example that Info.plist is sort of highlighted. Just double click on the value and change it to (in my case) resources/Info.plist and click on “OK”. If you’ve moved your precompiled headers, you’ll want to do aÂ similarÂ adjustment to the setting “Prefix Header”.Â
Once you’ve got that completed, you’re back in action and can compile your code up without issue. And yeah, for the record – I fully expect that I’ll forget this and come looking for it again in another 9 months or something. I just hope I can find it then…