I have 3 buttons in a single view. All three can be given the same IBAction. But how to know which button was pressed?
I tried implementing the following code:
But for all buttons, the answer is always 0.
Is there something I am missing here?
Or is there any other alternative?
Thanks
I tried implementing the following code:
Code:
-(IBAction)callAction:(id)sender {
UIButton *b=(UIButton *)sender;
NSLog(@"button pressed is : %d", [sender tag]);
}
But for all buttons, the answer is always 0.
Is there something I am missing here?
Or is there any other alternative?
Thanks