• 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: Header files are included in built package resources
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Header files are included in built package resources


  • Subject: Re: Header files are included in built package resources
  • From: Alan Hart <email@hidden>
  • Date: Mon, 6 Mar 2006 00:50:27 +0000


On 6 Mar 2006, at 00:10, Chris Espinosa wrote:


On Mar 5, 2006, at 3:06 PM, Alan Hart wrote:

When I build my little Cocoa app I find copies of my header files in the Resources directories of my builds. I see no reason why this is done, but I can't find a build switch to turn it off, and I can't find any reference to it in the documentation.

The docs never come right out and say it, but if you're building anything but a framework, you shouldn't add your header files to the target.  You can add them to the project (and it's especially useful to do so for SCM, searching, and navigation purposes) but you don't have to; the Header Search Paths and #include directives will find your headers whether they're in the project or not.

If you add the headers to the target, however, they'll be processed by one of the target's build phase.  Since it doesn't make sense to compile them on their own, and you don't have a Copy Headers build phase (like frameworks do) to publish a public interface, any headers you add to an application target are treated just like any other miscellaneous file: they're treated as resources and copied in your Copy Bundle Resources build phase.

To undo this:

1) Disclose the target's build phases in the Groups and Files view
2) Select Copy Bundle Resources.  Your Detail view will show all the bundle resources.
3) Type ".h" into the Search Field to select and filter all of the header files
4) Select All in the Detail view and click Get Info to open an inspector
5) In the Targets tab of the inspector, uncheck the application target

This will remove all those headers from the target (and thus the Copy Bundle Resources build phase) but not affect compilation of the sources that use those headers, or finding or SCM management of the header files themselves.

Chris and James

Thanks for your quick replies. I guess I have a lot to learn about some of the subtle distinctions in XCode. For a simple little project it never occurred to me to worry about the difference between inclusion in "Project" and "Target". I have enough trouble keeping track of the different "Builds".

Having explored the mysterious Targets area of Groups and Files, they seemed to be grouped together in the "Copy Files" build phase of the target. I deleted them from there, discovering with some relief that this only removed the references and not the files themselves. I also note the check box in the detail view under the little target icon, which seems to do the same thing without all the "Are you sure?" drama. Just have to do a periodic trawl to weed them out I guess.

Alan
 _______________________________________________
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

References: 
 >Header files are included in built package resources (From: Alan Hart <email@hidden>)
 >Re: Header files are included in built package resources (From: Chris Espinosa <email@hidden>)

  • Prev by Date: Re: Header files are included in built package resources
  • Next by Date: Re: C++ RTTI/dynamic_cast across shared module boundaries?
  • Previous by thread: Re: Header files are included in built package resources
  • Next by thread: Re: Header files are included in built package resources
  • Index(es):
    • Date
    • Thread