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: Chris Espinosa <email@hidden>
- Date: Fri, 11 Jul 2008 08:57:55 -0700
On Jul 11, 2008, at 2:36 AM, Jonny Taylor <email@hidden>
wrote:
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.
Chris
_______________________________________________
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