您的当前位置:首页正文

iOS开发点击cell上的按钮获取当前cell的索引

来源:要发发知识网
    UIView *view = sender;
    while (![view isKindOfClass:[UITableViewCell class]]) {
        view = [view superview];
    }
    MeterReadingManageContentCell *myCell = (MeterReadingManageContentCell *)view;
    NSIndexPath * indexPath = [self.tableView indexPathForCell:myCell];