How do I add custom data while specifying a target in a UIButton
?
id data = getSomeData();
[button addTarget:self
action:@selector(buyButtonTapped:event:)
forControlEvents:UIControlEventTouchUpInside];
I want the buyButtonTapped
function to look like:
(void) buyButtonTapped: (UIButton *) button event: (id) event data: (id) data
See Question&Answers more detail:os