button 获取 cell

mac2022-06-30  18

- ( void )cellBtnClicked:( 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 )      {          // do something      }

}

 

转载于:https://www.cnblogs.com/Cheetah-yang/p/4699475.html

相关资源:点击button获取所在UItableviewcell的所有属性
最新回复(0)