Is there anyway to format the code in Xcode like you can do in Eclipse or Netbenas. I have not found any option in menu, is there any hot key for this or its simply not in X
My personal favorite code formatter is Uncrustify. It has many, many options, so I also suggest you download UniversalIndentGUI, a GUI to help set Uncrustify's behavior to your liking.
If you love looking your code like me, you really need this shortcut :)
You have to select with CMD + A for reformatting whole code segment.
All you need to do this, select the code segment which you want to reformat it and press : Ctrl + I Magically, It is just reformatted
You can also highlight the code you want to re indent, and use the re-indent command
^-I (control - capital i) : format the current line
⌘-A + ^-I : format the whole code file
In Xcode 4, it's been moved to Editor > Structure > Re-Indent
command (and has a default shortcut of CTRL+I ).
Not saying this is best approach, but for completeness, if you cut and then paste the code back in, Xcode will automatically format it for you.