• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Why did my changes suddenly disappear?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why did my changes suddenly disappear?


  • Subject: Re: Why did my changes suddenly disappear?
  • From: Brian Syme <email@hidden>
  • Date: Wed, 22 May 2013 16:04:45 -0700

> You shouldn't really be adding files from a derived data directory to your main project. The derived data is (by design, as I understand it) intended to be a throwaway intermediate set of files.

That's what I thought too. But the xcode build system allows libraries to mark headers as private, project or public. The public headers are copied to a derived data directory. And this directory is in the default search path. So you would think that's the intended use. Maybe I'm missing something.

Your suggestion is what I've ended up doing though in order to work around the problem I described. It avoids a few other kinks as well. Apple should probably just remove the broken public/private/project header functionality - it seems too broken to be useful.



On Wed, May 22, 2013 at 11:18 AM, Quincey Morris <email@hidden> wrote:
On May 22, 2013, at 10:34 , Brian Syme <email@hidden> wrote:

But I have an annoying problem. During the build static library public headers are copied to a location in the derived data directory. Occasionally I end up opening this copy of the header in Xcode (probably by right clicking on a type declared in the header and selecting Jump To Definition.) I sometimes forget this (Xcode doesn't make it particularly obvious that I'm looking at the copy - a slightly different jump bar path is the only difference) and make changes to the copy, which are promptly overwritten by the next clean build. Annoying, to say the least.

So I'm looking for possible solutions to this. Ideally Xcode would know to open the original and not the copy (somehow) but I would settle for just making the copy read only in Xcode as a way to guard against editing it. I suppose I could do this with a custom build step.

You shouldn't really be adding files from a derived data directory to your main project. The derived data is (by design, as I understand it) intended to be a throwaway intermediate set of files.

Instead, add the library project to your main project's workspace, and add the library's product to the main project's Link With Binaries build phase. That way, if you edit any library public headers, you're editing the files in the real library source folder(s). Then Xcode (in effect -- it may take some shortcuts transparent to the build process, in your normal debugging workflow) will re-build the library for you, and recompile main project files that depend on the library header files. Using this approach also allows Xcode to use the appropriate library configuration (Debug, Release, etc) if you switch configurations for the main project.

If you need to build a distributable library separate from the main project, use Project --> Archive on the library target. 


 _______________________________________________
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

  • Follow-Ups:
    • Re: Why did my changes suddenly disappear?
      • From: Quincey Morris <email@hidden>
References: 
 >Why did my changes suddenly disappear? (From: Brian Syme <email@hidden>)
 >Re: Why did my changes suddenly disappear? (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Why did my changes suddenly disappear?
  • Next by Date: Re: Why did my changes suddenly disappear?
  • Previous by thread: Re: Why did my changes suddenly disappear?
  • Next by thread: Re: Why did my changes suddenly disappear?
  • Index(es):
    • Date
    • Thread