tags:

views:

13

answers:

1

I'm sure there's an easy to do this:

for (i=0; i<10; i++) {
    IBOutlet UIButton *button+i;
}

instead of this:

    IBOutlet UIButton *button0;
    IBOutlet UIButton *button1;
    IBOutlet UIButton *button2;
    IBOutlet UIButton *button3;
    IBOutlet UIButton *button4;
    IBOutlet UIButton *button5;
    IBOutlet UIButton *button6;
    IBOutlet UIButton *button7;
    IBOutlet UIButton *button8;
    IBOutlet UIButton *button9;

but my objective-c is not so good. Can someone help?

+2  A: 

This is not possible. IBOutlet is a keyword that is interpreted by Interface Builder.

It only makes sense in the .h file, never in any loop.

Eiko
I was hoping I could use a loop in the implementation of the .h file, but I guess not. Thanks.
Jesse Kochis