EDIT :
I\'m making an app like a Slot Machine, i added iCarousel
for the slot object.
So I have a button that rotates the iCarou
Without extending UIButton you can add a unique TAG to the button, getting the tag from the source of the UIEvent.
IE:
-(void) buttonSetupMethod {
for(each item) {
UIButton * button = [[UIButton alloc] init];
... additional setup ...
button.tag = SOME_UNIQUE_TAG_FOR_BUTTON;
[button addTarget:self action:@selector(processaction:) forControlEvents:desiredEvents];
... retain button ...
[button release];
}
}
-(void) processAction:(id) source
{
UIButton * button = (UIButton *) source;
int tag = button.tag;
... conditional logic on specific tag ...
}
for additional information on passing parameters see : Passing parameters on button action:@selector