Adding an existing implementation file to an Xcode project won't work

addition, file, xcode

Solution

I think I saw a similar problem once with an old version of Xcode. IIRC the way I resolved it was to:

- rename the source file (temporarily)

- add the renamed file to the project

- do a "Save As..." on the renamed file to get it back to the original name

Problem

As I write most of my code using MacVIM, I need to add the new files to the XCode project in order to compile them into the executable. Today however I encountered an implementation file (.m) which XCode won't allow to be added. It appears light gray in the appropriate finder window as if it were already included in the project, but when I try to build, I get a linker error, stating that the symbol defined this implementation file could not be found. The corresponding header file could be added without problems. Any idea what could have caused this problem? Btw. I deleted a former version of the same file from the "Classes" tree before, as well as many others which were successfully re-added.

Original source