I have a UIButton
in a custom UITableViewCell
. This button triggers an event when clicked.
[myButton addTarget:self action:@selector(b
As you rightly say, the button is "in" the cell - in the sense that it is a subview, at some depth, of some cell. So simply walk up the view hierarchy until you reach the cell:
- (void) buttonClicked:(id)sender {
UIView* v = sender;
while (![v isKindOfClass:[UITableViewCell class]])
v = v.superview;
// now v is the cell
}