
HI,
How find which button is clicked with the help of tag id of the button?
Thanks

HI,
You can typecast the sender object into button and then get the tag. Following code show how to do this:
- (void) buttonPress:(id)sender{
NSLog(@"Button pressed");
UIButton* myButton = (UIButton*)sender;
NSLog(@"Button Tag is: %d",myButton.tag);
}
Thanks

Hi,
After running the example you will get following output:
2010-12-21 22:21:22.779 MyAPP[2812:207] Button pressed 2010-12-21 22:21:22.780 MyAPP[2812:207] Button Tag is: 1 2010-12-21 22:21:25.635 MyAPP[2812:207] Button pressed 2010-12-21 22:21:25.636 MyAPP[2812:207] Button Tag is: 2 2010-12-21 22:21:26.691 MyAPP[2812:207] Button pressed 2010-12-21 22:21:26.692 MyAPP[2812:207] Button Tag is: 3
Thanks
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.