Information Technology Reference
In-Depth Information
Chapter 5:Working with Files,
Frameworks, and Classes
In This Chapter
Adding new files to a project
Working with groups
Working with frameworks
Xcode projects include a list of constituent files. When you build a project, Xcode processes each file in turn.
Source code files are compiled into binaries and linked together. Resource files are copied to the project's output
folder, also known as its bundle .
Each step in the process is known as a build phase. If your project has special requirements, you can customize
the build phases or create custom build phases—for example, to compile source code in a specific sequence, al-
lowing for dependencies. More typically, you can use the default build phases as they are.
You can define the files included in a project in two ways. The simple way is to use the file management features
built into the Project navigator. For more advanced management, you can use the features introduced in Chapter
13 to customize Xcode's default build phases. For simple apps, you can usually ignore this option, because the
build phases “just work.”
CROSS-REFERENCE
For more information about custom builds and build phases, see Chapter 12.
Working with Files and Classes
The Project Navigator includes all the features you need for basic file and class management. The Navigator is
easy to work with, but it's worth emphasizing again that there is an indirect relationship between the files and
folders (or groups) that appear in the Navigator, and the contents of the project folder on disk.
When you create a new Xcode project, the new files are added to a single folder. But this is a convenience, not a
necessity.
You can create a working project where the “official” project folder is empty, and every file is in a different physic-
al folder. Project files don't have to be local; they can be anywhere on disk or on a network. This makes it easy to
reuse source code and create libraries. The same library code can be referenced from multiple projects without
copying.
Search WWH ::




Custom Search