第一种:
- (void) btnOnClickTouched:(UIButton *)aButton
// WTAVViewCell * myCell = (myTableViewCell *)[aButton superView]; //表示Button添加在了Cell中。
//如果将Button添加在myCell.contentView 中,
WTAVViewCell * myCell = (WTAVViewCell *)[[btn superview] superview] ;
NSIndexPath *indexPath = [self.tableView indexPathForCell:myCell];
NSLog(@"%ld %ld",indexPath.row,indexPath.section);
}
第二种:
[cell.button addTarget:self action:@selector(handMarkTagAction: event:) forControlEvents:UIControlEventTouchUpInside];
- (void)deleBtnclick:(UIButton *)btn event:(UIEvent *)event{
// NSSet *touches = [event allTouches];
// UITouch *touch = [touches anyObject];
// CGPoint currentTouchPosition = [touch locationInView:self.tableView];
// NSIndexPath *indexPath =[self.tableView indexPathForRowAtPoint:currentTouchPosition];