Re: Header files get copied to app bundle?
Re: Header files get copied to app bundle?
- Subject: Re: Header files get copied to app bundle?
- From: James Bucanek <email@hidden>
- Date: Tue, 14 Feb 2006 08:36:37 -0700
Jonathan del Strother wrote on Tuesday, February 14, 2006:
>Why are new header files automatically inserted into the 'Copy Files
>to Contents' build stage in XCode? Is there any way of preventing
>this behaviour?
This is side-effect of how Xcode determines what files can be added to a target. In short, if you have a build phase in your target that will accept any kind of file, then ancillary files like headers are often added unintentionally.
In my (upcoming) book, I explain this in detail and offer this tip:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ridding Targets of Unwanted Files
It is very easy, when adding lots of new source files to a
project, to end up with files in targets where they don’t
belong. This most often happens when adding source and
header files at the same time. Targets that compile C source
into object files (native targets) normally only accept C,
C++, or Objective-C source files. Trying to add the
companion header files to those targets at the same time
does nothing. But some native targets have a Copy Files
phase that accepts any kind of file. The end result is that
all of the .h files get added to the target’s Copy Files
phase, and the target dutifully copies all of the headers
files in your project into the final application! This is
probably not what you want.
To fix this, select the Project Structure group in the
Groups & Files list to display all of the files in the
project in the details window (choose View > Details if you
are using the Condensed layout style). In the details list,
click on the icon (file type) column to sort the items by
type. Click on the first header file in the list, then
scroll down and Shift-click on the last one selecting all of
the header files in the project. Now choose File > Get Info
to get an aggregate Info window for all of the header file
items. Switch to the Targets tab and uncheck all of the
targets. This will remove all of the header files from all
of the targets in your project.
You can adapt this technique to make similar changes in
other types of files.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cheers,
James
James Bucanek
____________________________________________________________________
Author of Beginning Xcode ISBN: 047175479X
<http://www.beginningxcode.com/> Available April 3rd, 2006
_______________________________________________
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