1.在自定义cell中定义一个button,在 cellForRowAtIndexPath写出点击方法
[cell.button addTarget:self action:@selector(classAction:event:) forControlEvents:UIControlEventTouchUpInside];
2.实现classAction:event:方法
-(void)classAction:(UIButton *)button event:(UIEvent *)event{
//通过触摸点获取indexPath
UITouch *touch = [[event allTouches] anyObject];
CGPoint point = [touch locationInView:self.tableView];
NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:point];