Search code examples
iphoneobjective-cvariablesmethodssettext

How to use method on multiple variables on one line


How can i do this:

[wage setText:@""];
[hours setText:@""];
[grossPay setText:@""];
[taxes setText:@""];
[netPay setText:@""];

in one line?


Solution

  • Don't do it in one line. Do it so that it's easy to understand. To quote Brian Kernighan:

    Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?