Information Technology Reference
In-Depth Information
Because groups are completely free-form, you can organize your project however you like. There's no need to
use the default organization, with separate class and resource groups. For example:
For an iOS project, collect each view controller and its associated nib into a separate group. This is usu-
ally easier to navigate than keeping classes and nibs separated.
If your project uses many supporting graphics files, group them into a separate Graphics folder to keep
them distinct from other resources. This simplifies graphic previews and makes it easier to find the project
nib files.
Similarly, you can keep other project resources such as plists and code-signing files in a separate group to
keep them out of your way.
Source code for frameworks and libraries should have its own separate groups, especially if the files are
imported from a standard location on disk. It's a good idea to keep these items separated from project
source code.
Working with Frameworks
Apple's frameworks are prewritten libraries that can be imported into any project to add specific features, such
as support for video, sound, data management, or various hardware features.
When you build an OS X or iOS project, you may need to add one or more of Apple's frameworks to your pro-
ject before you can use them. A selection of default frameworks is included in every application template; for
example, OS X projects always include the Cocoa and AppKit frameworks, and iOS projects always include Co-
coa Touch, UIKit, and CoreGraphics. All projects include the Foundation framework.
Other frameworks are optional, and you must add them manually. For example, you must add the GameKit
framework to use the classes and methods built into GameKit. If you don't, the compiler can't find the symbols
included in the framework, and your build fails, sometimes spectacularly, with hundreds of errors.
TIP
If you do get hundreds of errors while building, it usually means you've forgotten to import a framework. Typic-
ally, most of the errors disappear after you add the framework correctly. Don't forget that you also need to import
the framework's header file into every file that references it in your project.
Using frameworks
Although you could add every framework to every project, this would slow build times to a crawl. Depending
on the build options, including every framework might also create huge binaries. So it's standard practice to
add only the frameworks that are referenced by your code.
TIP
You'll often use at least one of the standard graphics frameworks and perhaps also one of the animation frame-
works. It's easy to forget to add frameworks, and adding the headers by hand is a chore. You can save time by cre-
Search WWH ::




Custom Search