« Cmd - click. The subtle secret of Mac OS X. | Main | Leopards Etc »

August 01, 2005

Using Xcode to become a faster programmer

You can utilize some of Xcode's cool features to become a faster Mac OS X programmer. Here are some things which you may not know:

1. Use Code Completion (Code Sense). However, the default keyboard shortcut is lame. Go to the Xcode preferences, Key Bindings:

Keybindingsinxcode

and change the Code Sense Completion List binding to be Ctrl-Space (I use Option-Space, but really it is the ctrl-key, because I like to swap my ctrl and option keys):

Xcodecodesensebinding

While you are there, set the Code Sense Select Next Placeholder to be Ctrl-/ (that is control forward slash, and again, I have mine set to be option-/ because I swap my keys):
Codesensenextcompletion

2. Now that you have it properly setup, use it! Here is how you should be using it:

You want to call a particular method in your current class (self). Type the first few characters:

Usingcodesense1

Hit Ctrl-Space to bring up the Code Sense window:

Usingcodesense2

Type a few more characters to narrow down what you want, and arrow key down to select the signature you want to use:

Usingcodesense3

Hit enter to add the template into your source code:

Usingcodesense4

Fill in the first parameter:

Usingcodesense5

Then, hit Ctrl-/ to go the next completion item and highlight it:

Usingcodesense6

Repeat with more Ctrl-/ commands until you are done.

3. Congratulations! You are now a faster programmer.

--corbin

Posted by corbin at August 1, 2005 10:44 PM

Comments

If I am not mistaken, isn't there autocomplete for common statements like alloc/init and looping constructs as well?

Posted by: Luke at August 2, 2005 05:47 PM

Hi Luke -- yes, you are correct! Try code completion in various scopes for different information.

Posted by: corbin at August 4, 2005 04:58 PM

Post a comment




Remember Me?