iOS 点击cell上的按钮获取行数

-(void)btnClick:(UIButton *)button{
    UITableViewCell *cell = (UITableViewCell *)[[button superview] superview];
    // 获取cell的indexPath
    NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
    NSLog(@"点击的是第%ld行按钮",indexPath.row);
}
原文地址:https://www.cnblogs.com/xsphehe/p/5937639.html