Important: The information in this document is obsolete and should not be used for new development.
The project lets you pull together all of the files and other information required to build a set of related software products. Within a project, you use a target to specify the files needed for an individual product. The files can reside at any location in your file system; they do not need to be placed in your project folder. A project can contain:
Files. A source file is any file that Xcode uses in building a target, including source code files, resource files, image files, and others. For files you need direct access to in Xcode—for example, files you wish to edit using Xcode’s editor—you should explicitly add a reference to each file to the project. This includes source code files you want Xcode to compile.
Folders. If you have a folder of files that you manipulate as a whole—such as a folder of help files—you can simply add a reference to the folder to your project. This allows you to manipulate the folder in Xcode instead of touching each file individually. (To access any of the files individually from Xcode, you must also add a reference to the file to your project.)
Frameworks. You can add a reference to each of the frameworks that your product links against. This gives you easy access to the framework’s headers, directly in the project window.
When you create a project using Xcode’s project templates, described in “Choosing a Project Template,” Xcode populates the project with a small set of default files required to build the associated product. For example, the figure below shows the contents of a new project created using the Carbon Application project template. This project builds a small C application with a NIB-based interface that links to the Carbon framework. The project contents have been expanded in the Groups & Files list to display its contents in outline view. Of course, keep in mind that the contents of a project vary depending on the project template and the products it creates.
The example project contains the following items:
The Sources
group contains implementation files; in this case the main.c file.
The Resources group contains resource files for the application.
This includes the main.nib file that
defines the user interface, the Info.plist property
list file, and the Infoplist.strings files
containing strings used in the interface.
The External Frameworks and Libraries group contains references to the frameworks that define the system interfaces used by the application’s code. You can view a framework’s header files by disclosing the contents of the framework in the Groups & Files list.
The Products group contains references to the products created when the project’s targets are built. A product reference is a special type of file reference that refers to the build system output for a particular target. A product reference lets you view your target’s products right in the Groups & Files list. You can use the product reference to refer to the product in the same way you use a file reference to refer to a project file. Note, however, that the product reference does not actually refer to anything until you have built that target.
Xcode keeps a reference to each file, folder, and framework you add to your project. In this way, Xcode can find your files directly when it builds a product. However, Xcode also provides build settings for specifying general search paths for various items, such as headers and libraries. These include the Header Search Paths, Library Search Paths, and Framework Search Path build settings.
Last updated: 2006-11-07