I have a UIView with a bunch of buttons in it (something like 200 of them)...
The view was set up in IB so I would have to manually wire every button with a single handler...
I'm trying to traverse the subviews of the view, looking for buttons and then set the button's target programmatically... which results in a crash (I get the compile warning «UIButton may not respond to addTarget...»).
this is the loop:
for(UIButton *aButton in self.view.subviews){
if([aButton isKindOfClass:[UIButton class]]){
[aButton addTarget:self selector:@selector(buttonClick:) forControlEvents:UIControlEventTouchUpInside];
}
}
I can access some of the properties of the button, like visibility and title... but not the action?
Any help greatly appreciated...!