tags:

views:

634

answers:

3

Is any way to autoformat a source code in the Xcode IDE?

+1  A: 

There isn't really an autoformat option in Xcode.

There is an option to re-indent the code, which will re-align the code according to the tab width set in your preferences, but that's about as far as it goes.

You might have better luck with a text editor like TextMate? I don't know for certain, but I know it supports Objective-C and has some macros, there may be a reformat option?

Jasarien
Thanks! Re-intent is what I need.
sashaeve
For more control of the code formatting, you can try uncrustify: http://uncrustify.sourceforge.net/
Rob Keniger
+1  A: 

More links re: formatting in this SO Question

nall
This should have been a comment (and, with your rep a vote to close as Exact Duplicate).
dmckee
+1  A: 

One trick is to select the code (either "select all" or just the section you want to re-format) - then cut, then paste it back. This triggers the automatic code formatting in the Xcode editor.

Paul R