Search This Blog

Thursday, February 23, 2012

XCode 4.2 #import FAIL!

(I've probably covered this in another post but I have gotten more details about the FAIL so I am posting again.)

Imagine a project with two folders A and B.  Folder "A" represents one version of some source code and contains files m1.[m/h] and m2.[m/h].  Folder "B" a version that's an update from "A" - same files but they will be modified.

Now create an XCode 4.2 project based on "A."

Build it and make sure it works.

Now add something that the compiler doesn't like to the m1.h file - a duplicate #define or similar.

Next remove the m1.[m/h] files (from the "A" folder) from the project - don't delete them - just remove the "references." 

Now drag the files from "B" with the same name into the project.

What you will find is that XCode 4.2 continues to look at the files from "A" until you physically rename them in the finder. 

After you rename them in the finder it forgets about them - so clearly its keeping some kind of "hard" reference to the original files even after you've asked it to forget the file.

This is a fundamental flaw as far as I can see - no documentation or much on the internet about it.

I suppose it could be an LVM compiler problem - its hard to tell.

Yet it continues to be a problem for me and its frustrating because this is Project UI 101 as far as I am concerned.

XCode should only include/import files explicitly in the project - even if duplicates are present in other include folders.

No comments:

Post a Comment