Search code examples
iosobjective-cxcodeclang

edit supporting files location for compiler in Xcode


I renamed the folder in which my Xcode project's supporting files are stored, and now I am unable to compile my project. I was able to edit the build settings to reflect the new folder name, but the build phases tab shows that my compiler is still using the old folder name, and I don't see any option for editing the compile sources. I even tried deleting the compile sources and re-adding them, but they still show the old folder name.


Solution

  • First, in Xcode, delete the problem files. But (important!) when asked, click "just delete" or whatever, not the option that also says "remove the files from the disk".

    Next, RMB on the folder where you want your classes to occur and click "Add existing files" or whatever. Navigate to where the files actually are and select them, then click "add" or whatever. (Be wary of instinctively double-clicking while navigating through the directories, as that will add the entire directory. If you do this, simply delete the added directory from your project and do the RMB again.)

    You shouldn't need to do anything else with build settings or whatever (other than to maybe undo some of your prior changes).