美文网首页
iOS 获取tableview自定义控件UIButton所在的

iOS 获取tableview自定义控件UIButton所在的

作者: 彗星来的那一夜 | 来源:发表于2016-11-04 16:53 被阅读21次
[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所在的

      本文链接:https://www.haomeiwen.com/subject/xplwuttx.html