CHAPTER 2: Appeasing the Tiki Gods
18
Your project window features a toolbar across the top, which gives you ready access to
a lot of commonly used commands. Below the toolbar, the window is divided into three
main sections, or panes.
The pane that runs down the left side of the window is called the Groups & Files pane.
All of the resources that make up your project are grouped here, as are a number of
relevant project settings. Just as in the Finder, clicking the little triangle to the left of an
item expands that item to show available subitems. Click the triangle again to hide the
subitems.
The top-right pane is called the Detail View (or just Detail pane) and shows you detailed
information about items selected in the Groups & Files pane. The lower-right pane is
called the Editor pane. If you select a single file in either the Groups & Files or Detail
pane and Xcode knows how to display that kind of file, the contents of the file will be
displayed in the Editor pane. Editable files, such as source code, can also be edited
here. In fact, this is where you will be writing and editing your application’s source code.
Now that we have the terminology out of the way, take a look at the Groups & Files
pane. The first item in the list should bear the same name as your project, in this case,
Hello World. This item is the gathering point for the source code and the other resources
specific to your project. For the time being, don’t worry about the items in the Groups &
Files pane except those under Hello World.
Take a look at Figure 2–4. Note that the disclosure triangle to the left of Hello World is
open, and there are five subfolders: Classes, Other Sources, Resources, Frameworks,
and Products. Let’s briefly talk about what each subfolder is used for:
Classes is where you will spend much of your time. This is where most
of the code that you write will go, since this is where all Objective-C
classes rightfully belong. You are free to create subfolders under the
Classes folder to help organize your code. We’ll be using this folder
starting in the next chapter.
Other Sources contains source code files that aren’t Objective-C
classes. Typically, you won’t spend a lot of time in the Other Sources
folder. When you create a new iPhone application project, there are
two files in this folder:
Hello_World_Prefix.pch: The extension .pch stands for
“precompiled header.” This is a list of header files from external
frameworks that are used by our project. Xcode will precompile
the headers contained in this file, which will reduce the amount
of time it takes to compile your project whenever you select Build
or Build and Go. It will be a while before you have to worry about
this, because the most commonly used header files are already
included for you.
main.m: This is where your application’s main() function is. You
normally won’t need to edit or change this file.