Here are some notes from WWDC’s Session 402 – Working Effectively with Xcode video (signin required).

Behaviors

Behaviors let you setup some nice editor defaults that make debugging and dealing with build errors less annoying in Xcode.

You can get to Behaviors via Xcode preferences (Command ,) -> Behaviors and changing the actions on the right, for various triggers on the left.

Here are some good simple ones to get you going.

Build generates new issues

Clicking on the ‘Build generates new issues’ trigger and selecting ‘Show tab named’ Build will open a new tab if a build error occurs and put the output there. This is nice because it doesn’t mess up your current edit file and force you to step back once you fix the error.

Run pauses

This one is handy for when you hit a break point, and you want to do your debugging in a separate tab called debug.

Console window

Say you want to bring up a console window anytime you run your application. In Behaviors select the ‘Run Starts’ trigger and select ‘Show a tab named’ and enter ‘Console’.

Define your own edit code behavior

By clicking the ‘+’ sign and assigning a shortcut key, you can define your own edit code behavior and hit a shortcut key every time you want Xcode to setup your current window for code editting.

Simply hit the ‘+’ sign

Double click the command key icon on that line

And assign a short cut (i.e. F10).

Then setup your behaviors (in this case I like to hide all the panels and menus I’m not interested in).

Emacs gestures

Xcode supports a lot of emacs key bindings:

Control A/E Beginning and end of line
Control N New line
Control B Backward
Control F Forward

Command Control E – inscope variable name change

Open Quickly options

Shift Command O opens a file quickly in Xcode.
To open new file in assistant editor go: Option Return

To open somewhere else tab go: Option Shift Return
and use the arrows keys to select open location.

Advertisement