Home > Articles > Home & Office Computing > Entertainment/Gaming/Gadgets

The iOS 5 Developer’s Cookbook: Six Fabulous Xcode Tricks

  • Print
  • + Share This
Looking to improve your Xcode-Fu? There are always so many tweaks and tricks to learn about this complex design environment. To help you on your way, here are six little Xcode 4.x tricks you might be able to use in your day-to-day development work, via the iOS 5 Developer's Cookbook by Erica Sadun, which will hit bookshelves this November.
From the author of

Switching Between Counterparts

If you're viewing an implementation (.m) file and want to jump to its header (.h) counterpart or vice versa, type Control-Command-Up Arrow. This keyboard shortcut instantly switches between files. If you're already in the assistant counterpart view, the two files will change places. The file that had been on the left will jump to the right.

Download Additional Sdks

Xcode does not automatically install with legacy SDK support. Want to install iOS 3.x or 4.x support? Open Preferences (Command-,) > Downloads > Components and install each element you want on an item-by-item basis.

Search Better

If you're only using the plain search field in the Xcode Documentation pane (Window > Organizer > Documentation), you're missing out on some great advanced features. Locate the little magnifying glass inside the search field. It has a tiny down-pointing arrow right next to it. Select that glass/arrow combination and choose Show Find Options. Instantly Xcode gives you access to advanced tweaks including Match Type (contains/prefix/exact), Doc Sets (choose which SDKs to search through), and Languages (C, Objective-C, C++, and JavaScript).

Save Disk Space

Working on a system with limited disk space? You can move a great number of Xcode components off-disk by installing the SDK to the external drive. When you do so, Xcode only takes up a few hundred Megabytes of storage rather than several gigabytes on your primary system. What's more, you can also move build products and archives off disk. Open Preferences (Command-,) > Locations and set custom folders for your Derived Data, Snapshots, and Archive files.

Show Line Numbers

Xcode offers an easy-to-access preference that allows you to switch on line numbers in the editor. Check Preferences (Command-,) > Text Editing > Line numbers and instantly add numbering to each code line. Want to jump to a line in-code? Type Command-L, enter a line number, and press return.

Select Debug Output

By default, the debug output area (Command-Shift-Y) shows both the visual debugger and the console. Three small buttons at the top-right of this pane allow you to control which elements you view. Only interested in console output? Click the rightmost rectangle. Want to see both? Click the middle. Pick the presentation that best works for you. And don't forget, you can choose your console debugger in the scheme edit menu. Locate the active scheme (to the right of the Run-Stop buttons at the top left of the editor window), choose Edit Scheme from that pop-up, then select Run > Info > Debugger. Choose between GDB and LLDB.

  • + Share This
  • 🔖 Save To Your Account