Re: Xcode project has lost track of file modification
Re: Xcode project has lost track of file modification
- Subject: Re: Xcode project has lost track of file modification
- From: Jonny Taylor <email@hidden>
- Date: Tue, 15 Jul 2008 07:38:32 +0100
- Authenticated-sender:
I have a project which doesn't seem to be correctly recognising
changes to one particular file. It is included as part of the
precompiled header, but alterations in the file do not prompt the
precompiled header to be rebuilt.
More worryingly, I made a whole series of modifications to the code
in that header which I subsequently found had been lost. I presume
that at some point and for some reason they were overwritten with
an old version of the content. The only strange thing I've done
with that file, a while ago, was to make a copy, trash the
original, and then update the project to point to the new copy.
Everything is apparently as it should be, but maybe something
strange has gone wrong behind the scenes.
Does anybody recognise these symptoms? I realise the information
I've given is necessarily vague, but I'd be grateful to hear from
anybody who's had similar problems. The loss of data is obviously
very worrying and I'd like to know for sure that that won't happen
again. I'm inclined to trash the entire project and start from
scratch, but that's going to be quite a task! Can anyone recommend
any less drastic measures that may help?
The most common cause of this is as follows:
1) Add a header to your project.
2) intentionally or accidentally add it to a target. This puts it
into a Copy Files build phase to be "published" when you build.
3) Build that target. You now have a copy of the header in a common
location.
4) In another target, use a source file that includes the header
from the first target.
5) Build the second target. It will use the published copy of the
header, not the original.
6) from the source file, use certain navigation techniques to go to
the header.
You're now in an ambiguous situation. The compiler and indexer for
the second target has no idea that the header actually used in the
build isn't the original. (Some parts can, others can't) So
sometimes you end up editing the copy, not the original -- and of
course the copy is blown away the next time you build the first
target.
Whenever possible, don't add headers to a target. Only do that when
building a framework or shsrtd library for distribution. And when
you do, always switch back to the franework target to edit its
public headers.
Actually, despite my earlier reply it seems that the problem is
persisting, and I don't think this is what's happening in my case.
There's one particular file which is having problems. There is only
one file with that name anywhere on this machine, and Xcode is the
only program that I ever open it with. Nevertheless, I intermittently
get messages that "another program" has modified the file, and do I
want to overwrite it or not. It seems that Xcode is somehow getting
out of sync between (I think) the file open in a dedicated window and
the same file as viewed in the build results window. Do you have any
further thoughts as to how I might be able to make this issue go away?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden