Xcode Objective-C Macros Cheatsheet For iPhone Programmers
Xcode provides short keyboard abbreviations, or macros, to save you keystrokes. This is similar to the “snippet” functionality in the popular TextMate editor.
The built in set include common directives, declarations, flow control, loops and other common text patterns you’re likely to key-in while programming iPhone applications.
To use a macro, enter the abbreviation, hit escape, and select the expanded text.
While the canonical list of the dozens on built-in macros can can be found in Apple’s Xcode Workspace guide, I’ve always found having a printed cheatsheet handy helps me get to that magical point where they come naturally, without even thinking about them.
To that end, I’ve created a handy single-page PDF containing the 34 macros you’ll use most often, organized and categorized for easy lookup. Enjoy!
In connection with those macros I have also changed some key definitions. First go to System Preferences > Keyboard & Mouse > Keyboard. Click on Modifier Keys… Change the Caps Lock to be the Control key (Who uses Caps Lock anyway?). Then do the opposite for the Control key. Next go to XCode > Preferences > Key Bindings > Menu Key Bindings. Open the Edit menu and scroll down until you see Next Completion. Define this as Control-; Then two spaces below that is Select Next Placeholder. Define that as Control-‘ (single quote).
Now you can hold the shift key down and type a ‘ to go to the next placeholder in method definitions. I find this much easier and fast than the default key assignments. Of course you can select different key to your taste.
Nice, that is really cool. I would like to link back to this from my website. Think this is a great resource.
Cool…
There’s a bunch of them actually, one that I use all the time is csep : it extends to a “C-Separator” line like this :
/*******************************/
Very useful along some #pragma mark – (the macro for this one is pm by the way) to clean up a file organization by groups of methods.
thanks for saying how to create the macros.