Chapter 16. Targets

WHAT'S IN THIS CHAPTER?

  • Creating targets

  • Adding source items to targets

  • Defining target dependencies

  • Customizing targets

Targets are the engines of Xcode. They define the steps that will transform your source code and resource files into a finished product. Targets can be very complex or ridiculously simple. Xcode comes with targets that automatically take care of the myriad details needed to produce standard products such as application bundles, or you can take complete control and choose a target that abdicates all of the responsibility for building a product to you.

The purpose of a target is to produce something. Most targets produce a product. There are different types of targets, depending on what kind of product is being produced. Each target refers to the source files and resources required to produce its product, along with the instructions on how those source files get transformed, how the product is assembled, and the order in which all of those things happen.

Targets appear in the Targets smart group of the project window, as shown in Figure 16-1. Most project templates come with a target already defined, appropriately configured for that project type. If you stick to developing simple applications and tools you may never need to add a target to an existing project. Nevertheless, understanding what a target is and does is a prerequisite to customizing one and is fundamental to understanding the build process as a whole.

Figure 16-1. FIGURE 16-1

TARGETS VS. ...

Get Professional Xcode® 3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.