Is any way to autoformat a source code in the Xcode IDE?
ctrl + I will auto format the code you're selecting
Yes Xcode 4 has an autoformat feature.
Try following:
Please also see here: Fix code indentation in Xcode