自定义cell中有一个button按钮,按下按钮的同时如何获得该按钮所在的行的row值(也就是既要响应button事件也要响应- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath事件),麻烦各位大神指教


ios 自定义cell uitableview
------解决方案--------------------
[(UIButton *)[cell viewWithTag:5] addTarget:self action:@selector(btnPress:) forControlEvents:UIControlEventTouchUpInside];
UIButton *btn=(UIButton *)[cell viewWithTag:5];
btn.tag=indexPath.row+100;
------解决方案--------------------
给button设定tag值,跟row值有固定的关系