On May 20, 2005, at 11:22 AM, Theodore H. Smith wrote: Xcode doesn't seem to handle moving projects about or renaming stuff so well...
I moved one project, and some of the files could no longer be found, although others could, which is strange.
Most notably, even the executable path was built wrong.
Is there something I can do about this to prevent or fix it?
1) Check your file references. None should be "Absolute," though Xcode 1.5 and earlier had a nasty penchant for creating them that way, even when you asked it not to. (Select the "red files", choose Get Info, look in "Path Type". If it's "Absolute", click "Choose" and find the file, then set the path type to "Relative to project" or "Relative to Enclosing Group". The latter is preferred as it will then survuve not only moving the project around, but also moving directories within the project)
2) Open your foo.xcode/project.pbxproj file in some text editor and search for entries with "source tree = "<absolute>". You can manually edit these references to be
refType = 4; sourceTree = "<group>"; path = "filename.c"; /* just remove the absolute path to the filename */
If you have a lot of them this is the easier way to do it.
Needless to say, do this after making a backup copy of your project file; editing the text of a project file always entails some risk.
Chris |