what would be a good way to format this piece of code?
UIBarButtonItem *prev = [[UIBarButtonItem alloc] initWithTitle:@"Prev"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(setDateRangeClicked:)];
Taking the question with another meaning, the best way to format that code is to use Xcode.
Highlight the code to format, then to to Edit -> Format -> Re-Indent and you will have your code in the “Standard” Xcode formatting.
I’ve mapped it to the keyboard shortcut alt-cmd-[ as I was used to TextMate. It’s buried under lots of menus, so a keyboard shortcut is handy for this. If you use TextMate, click inside the block to format and press ctrl-Q. TextMate has some problems with this style of formatting though.