05.01.2013 Views

Mac OS X Leopard - ARCAism

Mac OS X Leopard - ARCAism

Mac OS X Leopard - ARCAism

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

456<br />

CHAPTER 25 MAC <strong>OS</strong> X DEVELOPMENT: THE TOOLS<br />

Project Structure<br />

The first thing in the sidebar is the Project Structure smart group. Note that this smart group is<br />

unique in that its displayed name will be the same as your project’s. By default, it contains several<br />

subgroups, which look and behave like folders. These in turn contain all the source code and<br />

resources used by your project.<br />

Groups are created, deleted, and renamed via the contextual menu. (Recall that the contextual<br />

menu is what pops up when you Ctrl+click or right-click an item.) The groups can be moved<br />

or nested by dragging them. Items within the groups can also be moved by dragging them.<br />

It bears note that the groups within the Project Structure smart group have no actual relevance<br />

to your project, nor do they necessarily relate to the actual folders in your project’s folder;<br />

they are only there for your organizational convenience.<br />

Targets<br />

Xcode’s build system is organized into targets. A target contains the steps necessary to create a<br />

build product. Build steps include compiling source code, linking, and copying resources to the<br />

application bundle. By default, your project will only contain one target: the Hello World application.<br />

Very complicated projects may contain additional targets, such as plug-ins, frameworks,<br />

command-line tools, or Automator actions. Simple projects don’t have to worry about targets, as<br />

Xcode does a decent job of keeping a single target organized and updated.<br />

Executables<br />

Building a project isn’t much good unless you can run and debug it. Since Xcode handles these<br />

tasks, it needs to know any arguments, environment variables, or debugging attachments you<br />

want added when you run. Any executable products of your project, such as the Hello World<br />

application, will be kept in the Executables smart group.<br />

Upon selecting an executable in this group, typing Cmd+I will pull up an executable inspector<br />

where you can set things like arguments. As with targets, the default project will only contain<br />

a single executable.<br />

Errors & Warnings<br />

Sometimes a change can require so much code that by the time you can compile again, dozens of<br />

files have been touched. Even though Xcode 3 introduces error and warning pop-up bubbles, it’s<br />

still nice to have a list of all the files that have something wrong with them. The Errors & Warnings<br />

smart group is just such a list. Any file with an error or warning on it will be added to this<br />

smart group until the next compile.<br />

Find Results<br />

The Edit menu item’s Find subfolder reveals that Xcode has multiple levels of find. The familiar<br />

Cmd+F launches Single File Find, which does what it says. Typing Shift+Cmd+F (or clicking the<br />

magnifying glass toolbar item) launches Project Find. This is a bit of misnomer, as its focus can<br />

be broadened or narrowed from the project.<br />

In any case, all Project Find search results are saved in the Find Results smart group. On<br />

large projects, where searches can take several minutes, this is a big time saver.<br />

Bookmarks<br />

Another problem plaguing large projects is navigating the hierarchy of folders to get to the files<br />

you’re working on. To help you stay organized, Xcode lets you bookmark files. Bookmarked<br />

files show up in this smart group. To bookmark a file, right- or Cmd+click the file in the sidebar,<br />

details list, or editor to bring up its contextual menu, and select Add to Bookmarks.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!