To add to Tristan's answer, the button can also receive (id)event
in addition to (id)sender
:
- (IBAction) buttonTouchUpInside:(id)sender forEvent:(id)event { .... }
This can be useful if, for example, the button is in a cell in a UITableView
and you want to find the indexPath
of the button that was touched (although I suppose this can also be found via the sender
element).