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.

Bug Reporter<br />

Bug Reporter doesn’t come with Xcode, but it’s one of the most powerful tools available to you<br />

as a developer because it allows you to improve <strong>Mac</strong> <strong>OS</strong> X itself. The more you use your <strong>Mac</strong>,<br />

the more likely you are to find things about it that annoy you, things that don’t work like they’re<br />

supposed to, or things that Apple could do that would make it even better. These are all kinds of<br />

bugs, and they’re all filed the same way.<br />

To file a bug, go to Apple Bug Reporter (http://bugreport.apple.com/) and sign in with your<br />

Apple ID. Click the New Problem tab and simply fill out the form. Apple provides a link to a<br />

description format for those unfamiliar with good bug reporting practices, but here are a few tips<br />

for writing good bugs:<br />

• Ninety percent of fixing a bug is reproducing it. Once you can trigger a bug at will, it’s<br />

relatively easy to find out why it’s happening and do something about it. If you notice<br />

some unexpected behavior (or lack of behavior), try again to see if it happens again. Try<br />

similar things to see if they also trigger the bug. Basically, you want to narrow down the<br />

scope of the bug as much as possible, forming a narrative description that an engineer will<br />

be able to follow and reproduce, hopefully with the same results.<br />

• Because every system is different, and your system configuration might have something to<br />

do with the bug, you should always attach a system profile to your bug reports. To create<br />

a system profile, launch the System Profiler application, either by selecting About This<br />

<strong>Mac</strong> from the Apple menu and clicking the More Info… button, or by double-clicking the<br />

application icon in /Applications/Utilities. Once in System Profiler, save a profile by<br />

selecting Save from the File menu, or by the keyboard shortcut Cmd+S. There is a special<br />

button to attach your system profile in the Bug Reporter form.<br />

• If possible, attach some supporting documentation to the bug report as well. It’s one thing<br />

to describe how to reproduce a bug. It’s quite another to demonstrate it directly. If it’s a<br />

bug in Apple’s frameworks, write a trivial test program that shows the bug. If it’s a bug in<br />

an Apple application, an Instruments recording of the bug being triggered would be a good<br />

use of the tools. Zip up any supporting evidence, and attach it using the appropriate<br />

button in the Bug Reporter form.<br />

More Information<br />

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

There’s a lot more that could be said about the <strong>Mac</strong>’s development tools. Aside from Xcode’s<br />

own documentation, there are a few more online resources worth checking out:<br />

<strong>Mac</strong> <strong>OS</strong> X Debugging Magic (http://developer.apple.com/technotes/tn2004/tn2124.html):<br />

The complexity of Xcode yields all kinds of obscure tips and tricks. Debugging Magic is<br />

Apple’s documentation of several dozen. My personal favorite is the NSZombie class, which<br />

turns your deallocated objects in undead monsters that moan horribly if you try to send<br />

them messages. As awful as that sounds, believe you me, when you’re trying to track down<br />

a crash caused by messaging a floating pointer, NSZombie may just save your brain.<br />

Version Control with Subversion (http://svnbook.red-bean.com/): Subversion is my personal<br />

favorite version control program. If you want to learn what version control is, how<br />

Subversion works, and every possible detail of making Subversion work for you, you could<br />

go to the store and buy this book. Or, you could just read the whole thing for free online.

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

Saved successfully!

Ooh no, something went wrong!