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 |