Objective-C Tidy Objective-C Tidy xcode xcode

Objective-C Tidy


Uncrustify: http://uncrustify.sourceforge.net/

Source Code Beautifier for C, C++, C#, ObjectiveC, D, Java, Pawn and VALA

If you want something simpler, you could probably get some way by simply stripping out all the white-space/line-breaks, and adding a new line-break on ; { }, and manually re-indenting the code. It won't be anywhere near perfectly laid out code, and reindenting could be a pain on large code, but it will be consistent.


A simple, but limited, solution is Edit->Format->Re-Indent in Xcode, which will apply your current indentation settings (Xcode->Preferences…->Indentation).


According to this blog post, bcpp works with Objective-C.

In addition, the tool indent might help you. It's aimed at plain C but has a gazillion options that could help. I don't know if it comes by default on OS X though.

NAME       indent - changes the appearance of a C program by inserting or deleting       whitespace.SYNOPSIS       indent [options] [input-files]       indent [options] [single-input-file] [-o output-file]       indent --versionDESCRIPTION       This man page is generated from the file indent.texinfo.  This is  Ediâ       tion  of "The indent Manual", for Indent Version , last updated .       The  indent  program  can  be used to make code easier to read.  It can       also convert from one style of writing C to another.       indent understands a substantial amount about the syntax of C,  but  it       also attempts to cope with incomplete and misformed syntax.