iOS 获取tableview自定义控件UIButton所在的行数(UITableViewCell)

[cell.button addTarget:self action:@selector(cellButtonClicked:event:) forControlEvents:UIControlEventTouchUpInside];
// 点击事件
- (void)cellButtonClicked:(id)sender event:(id)event 
{ 
NSSet * touches =[event allTouches]; 
UITouch * touch =[touches anyObject]; 
CGPoint currentTouchPosition = [touch locationInView:_tableView]; NSIndexPath * indexPath = [_tableView indexPathForRowAtPoint:currentTouchPosition];
 if (indexPath!= nil) 

你可能感兴趣的:(iOS 获取tableview自定义控件UIButton所在的行数(UITableViewCell))