0

So I renamed my XCode 4.6.3 project in this manner:

  • I closed XCode and renamed the workspace in the physical directory.

  • I also renamed the project folder

  • I opened XCode and renamed the project folder in the virtual directory.

  • I tried to redirect the path in the Identity Inspector to relink the folders as described in this SO question: Renaming xcode 4 project and the actual folder. However, the links remained red. So I tried the approach in the second answer in that same question which is: ..1.. From the Finder, open the .pbxproj file inside project bundle (context menu "Show Package Contents") with any text editor. ..2.. Search and replace any occurrence of the original folder name with the new folder name.

This worked. The virtual links became black instead of red and the project compiled and ran.

HOWEVER, now I have 47 Use of undeclared identifier errors regarding not finding classes or constants. The project runs fine, and the classes exist and the filenames are black, but it's annoying to see all of those and it prevents me from realizing when there is a legitimate error.

Cleaning does nothing. Closing and reopening XCode will results in one build without any errors, but the next build will show the Use of undeclared identifier errors.

Community
  • 1
  • 1
OdieO
  • 6,836
  • 7
  • 56
  • 88
  • Did you try removing its build folder in DerivedData? And the ModuleCache directory too. – djromero Nov 15 '13 at 22:56
  • @djromero. That might've worked. Didn't try it. The uninformed fix in the answer below worked and I'm not looking back. – OdieO Nov 15 '13 at 23:44
  • In my case, my project was in a git directory. After renaming all the files, I had to add/commit for xcode to clean the warnings out – okcoker Jan 19 '17 at 09:01

1 Answers1

1

This turned out to be an issue with only precompiled values. I'm not exactly what caused the error, but I ended up renaming the .pch file, which caused an error saying it couldn't find the old .pch file. After renaming the file back to it's original name now all the errors have gone away.

Once again, for anyone reading this, I was able to compile as if there were no errors this whole time. However, since so many precompiler errors were appearing, it was extremely annoying because I couldn't discern the real errors easily.

OdieO
  • 6,836
  • 7
  • 56
  • 88