Make XCode Work For You With This Secret Trick!

Matthew Campbell, April 8th

Are you using XCode to it’s full potential?

If you have just started working with XCode then you may be making life harder on yourself by not using all of XCode’s built in tools. For instance, I recently found out that you can have XCode write bits of code for you by using something called “Text Macros”.

For example, from the main menu select “Edit”, “Insert Text Macro” and then “Objective-C” and you will see a list of code hints that you can use:

TextMacro1.jpg

Clicking on one of these text macros will write code into the file your working on. For instance, here I selected “Array Declaration” and this appeared in the file I was working on:

NSArray * array;

This is nifty when you are having a brain-freeze. Another useful one I found was “Array For Loop”:

ForLoopTextMacro.jpg

I like that you get the placeholders (the rounded circles) that you can fill in with your own objects. Check it out and see what how you can start to make XCode work for you!

I want to know what XCode tricks you have for the readers out there. Please share in the comments below:

I just made a blog post about this very subject a few days ago, explaining how to add text macros and giving a script for generating a properly formatted UUID: http://mcdevzone.com/2009/04/09/useful-xcode-tricks/

  • Hours of videos, demos & screen casts
  • SOURCE CODE
  • Detailed HANDS-ON Exercises
  • Much Much Much More
  • UIKit
  • Objective-C
  • Core Data
  • More!
  • Learn How To Make An iPhone App right now using my proven system.

    PS: Tons of us are having a blast living off our own code, join us now. Click here to get all the details.