Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

objective-c code formatting

Tags:

objective-c

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:)];
like image 265
Joo Park Avatar asked Jul 02 '26 04:07

Joo Park


1 Answers

You can, of course, do whatever you want. I like lining up the colons:

UIBarButtonItem *prev;
prev = [[UIBarButtonItem alloc] initWithTitle:@"Prev"      
                                        style:UIBarButtonItemStyleBordered
                                       target:self
                                       action:@selector(setDateRangeClicked:)];

I split up the declaration and the assignment just to get rid of the scroll bar.

like image 61
Carl Norum Avatar answered Jul 03 '26 18:07

Carl Norum



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!