-(void)btnClick:(UIButton *)button{
    UITableViewCell *cell = (UITableViewCell *)[[button superview] superview];
    // 获取cell的indexPath
    NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
    NSLog(@"点击的是第%ld行按钮",indexPath.row);
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
  • 2022-01-03
  • 2022-12-23
  • 2022-12-23
  • 2021-08-09
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-10
  • 2021-05-31
  • 2021-10-19
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案