« 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:

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):

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):
![]()
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:
![]()
Hit Ctrl-Space to bring up the Code Sense window:

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

Hit enter to add the template into your source code:
![]()
Fill in the first parameter:
![]()
Then, hit Ctrl-/ to go the next completion item and highlight it:
![]()
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