How can I get the name of the button instead of its title?
ex: if you click on button1 they log will be "button1"
thanx!
.h
.m
ex: if you click on button1 they log will be "button1"
thanx!
.h
Code:
IBOutlet UIButton *button1, *button2,*button3,*button4,*button5,*button6,*button7,*button8;
-(IBAction)tapped:(id)sender;
Code:
-(IBAction)tapped:(id)sender{
NSString *buttonNumber = [sender titleForState:UIControlStateNormal];
NSLog(@"%s",buttonNumber);
}