Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You sound as if you're looking for three major things: code templates, refactoring tools, and auto-completion.</p> <p>The good news is that Xcode 3 and later come with superb auto-completion and template support. By default, you have to explicitly request completion by hitting the escape key. (This actually works in all <code>NSTextView</code>s; try it!) If you want to have the completions appear automatically, you can go to <strong>Preferences</strong> -> <strong>Code Sense</strong> and set the pop-up to appear automatically after a few seconds. You should find good completions for C and Objective-C code, and pretty good completions for C++.</p> <p>Xcode also has a solid template/skeleton system that you can use. You can see what templates are available by default by going to Edit -> Insert Text Macro. Of course, you don't want to insert text macros with the mouse; that defeats the point. Instead, you have two options:</p> <ol> <li>Back in <strong>Preferences</strong>,go to <strong>Key Bindings</strong>, and then, under <strong>Menu Key Bindings</strong>, assign a specific shortcut to macros you use often. I personally don't bother doing this, but I know plenty of great Mac devs who do</li> <li><p>Use the <code>CompletionPrefix</code>. By default, nearly all of the templates have a special prefix that, if you type and then hit the escape key, will result in the template being inserted. You can use Control-/ to move between the completion fields.</p> <p>You can see <a href="http://crookedspin.com/2005/06/10/xcode-macros/" rel="noreferrer">a full list of Xcode's default macros and their associated <code>CompletionPrefix</code>es</a> at <a href="http://crookedspin.com" rel="noreferrer">Crooked Spin</a>.</p> <p>You can also add your own macros, or modify the defaults. To do so, edit the file <code>/Developer/Library/Xcode/Specifications/{C,HTML}.xctxtmacro</code>. The syntax should be self-explanatory, if not terribly friendly.</p></li> </ol> <p>Unfortunately, if you're addicted to R#, you will be disappointed by your refactoring options. Basic refactoring is provided within Xcode through the context menu or by hitting Shift-Apple-J. From there, you can extract and rename methods, promote and demote them through the class hierarchy, and a few other common operations. Unfortunately, neither Xcode nor any third-party utilities offer anything approaching Resharper, so on that front, you're currently out of luck. Thankfully, Apple has already demonstrated versions of Xcode in the works that have vastly improved refactoring capabilities, so hopefully you won't have to wait too long before the situation starts to improve.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload