I have created an IBAction like this: -(IBAction) buttonTapped:(id)sender; and connected it to a UIButton using interface builder, the problem is that I can’t do something like NSLog(@"%d",sender.tag); the compiler gives me syntax error that the tag property does not exist in object of type id … but however when I do something like NSLog(@"%@", sender); the console displays info about the button and its tag … so the question is: how can I reach the tag property of the UIButton through the sender object ?
I have created an IBAction like this: -(IBAction) buttonTapped:(id)sender; and connected it to a
Share
Have you tried casting
sender? For example: