- indexPath 为空,不设置前置条件,刷新容易崩溃
- [self.tableView indexPathForCell
- 转发一个大神的经验indexPathForCell返回nil的问
- tableView-reloadData后setContentO
- iOS11 tableView-reloadData后setCo
- iOS开发 -- UITableview reloadData后
- iOS tableView 嵌套tableView或者colle
- iOS11 tableView-reloadData后setCo
- [_tableView indexPathForCell:cel
- ios 调整cell分割线左边空白
我是要对cell 多个按钮做事情,然后遇到这个问题,
indexPathForCell
反馈 nil
解决方法
按钮对外事件
if ([button isKindOfClass:[UIButton class]]) {
UIView *view = button;
while (![view isKindOfClass:[UITableViewCell class]]) {
view = [view superview];
}
}
- (void)onActionOrderOk:(UIButton *)button
{ // 同意
if ([button isKindOfClass:[UIButton class]]) {
UIView *view = button;
while (![view isKindOfClass:[UITableViewCell class]]) {
view = [view superview];
}
//UIView *contentView = [button superview];
//MyOrderVCCell_2 *cell = (MyOrderVCCell_2 *)[contentView superview];
MyOrderVCCell_2 *cell = (MyOrderVCCell_2 *)view;
NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
UIButton *okbtn = [cell viewWithTag:indexPath.row + 40012];
okbtn.hidden = YES;
UIButton *nobtn = [cell viewWithTag:indexPath.row + 50012];
nobtn.hidden = YES;
UIButton *okReceiptbtn = [cell viewWithTag:indexPath.row + 70012];
okReceiptbtn.hidden = NO;
XPFLog(@"%@----%@", indexPath, self.dataMutAry[indexPath.row]);
}
}






网友评论