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.

SCM<br />

If you’re using version control in Xcode, any file that has been changed will be added to the SCM<br />

results details pane, as well as the SCM smart group. Items in the SCM smart group have version<br />

control commands in their contextual menu, which makes it easy to commit, revert, or diff a<br />

single file.<br />

The SCM smart group’s icon turns into a progress indicator during version control operations,<br />

so you can keep an eye on how your commit is going while getting ready to break things<br />

again.<br />

Project Symbols<br />

Unlike the other smart groups, Project Symbols doesn’t have a disclosure triangle revealing a<br />

hierarchy of files. Rather, it’s just there so you can select it and bring up its details panel. Doing<br />

so yields a list of every symbol, which is to say, every method, function, ivar, struct, global, typedef,<br />

protocol, property, and macro, as well as anything defined in a Core Data model or Interface<br />

Builder nib.<br />

Why would you need a gigantic list of every symbol in the project? Who knows! But when<br />

the day comes, you’ll probably be glad it’s there.<br />

Implementation Files/NIB Files<br />

Aside from the built-in smart groups, you can create your own. Although they are functional and<br />

potentially useful, the Implementation Files and NIB Files smart groups are really samples of the<br />

kinds of things you could do. To create a smart group, select an option from the Project menu’s<br />

New Smart Group submenu.<br />

To edit an existing smart group, select Get Info from its contextual menu, or select it in the<br />

sidebar and type Cmd+I. Aside from defining a name, filter, and scope for the group, you can<br />

also set its icon. Regardless of whether that’s useful, it’s pretty cool.<br />

Breakpoints<br />

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

While running your program in the debugger, you may want to stop at a certain line of code to<br />

examine the values of variables, test some method calls, or just follow along line-by-line to see<br />

what’s happening. To mark lines for the debugger to stop, or break, you set breakpoints. Breakpoints<br />

are also handy placeholders in their own right. To help you examine or jump to a certain<br />

breakpoint, they are all listed under the Breakpoints smart group.<br />

TIP Xcode also has a Favorites bar, which is similar to the Bookmarks bar in Safari. You can<br />

reveal the Favorites bar by selecting Show Favorites Bar from the Layout submenu of the View<br />

menu. Dragging files, groups, or smart groups to the Favorites bar will add them. Clicking an<br />

item in the Favorites bar will select it in the Groups & Files sidebar.<br />

One thing I’ve noticed about Apple applications: they always include amazing templates.<br />

You can fire up anything in iLife or iWork and you already have a fully functional, if somewhat<br />

boring, web site, movie, song, DVD, presentation, or document. Xcode is the exact same way.<br />

Without typing anything, you’ve already started with a fully functional document-based application.<br />

To see this for yourself, build and run your project by selecting Build and Run from the<br />

Build menu, typing Cmd+R, or clicking the hammer icon on the toolbar. In short order, you’ll see<br />

a generic document, as seen in Figure 25-8.<br />

If you’re following along at home, you’ll notice one difference between your application and<br />

the one in Figure 25-8. Namely, yours says “Your document contents here,” and the one in the<br />

figure says “Hello World!” You can examine the source code all you want, but you’re not going<br />

to find it.

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

Saved successfully!

Ooh no, something went wrong!