If I have a large number of buttons installed in Interface Builder, how can I put them into an array through code?
For example, if I have three buttons and in the interface file I define them:
@property (nonatomic, retain) IBOutlet UIButton *button1; @property (nonatomic, retain) IBOutlet UIButton *button2; @property (nonatomic, retain) IBOutlet UIButton *button3;
If I want to rename each of these buttons to say βHelloβ, I want to be able to split them into an array, and then use a function such as:
for (int i = 0; i < someArray.count; i++) { someArray[i].text = @"Hello"; }
Can someone provide information on how this is achieved (if possible)?
thanks
achiral
source share