Ios block Thread 1: EXC_BAD_ACCESS (code=1, address=0x10)

problem description

Thread 1: EXC_BAD_ACCESS (code=1, address=0x10)

related codes

/ / Please paste the code text below (do not replace the code with pictures)

  • (UITableViewCell ) tableView: (UITableView ) tableView cellForRowAtIndexPath: (NSIndexPath *) indexPath

{

MainTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"set" forIndexPath:indexPath];
cell.selectionStyle = UITableViewCellSelectionStyleNone;

DSLBuShouItem * item = self.dataArray[indexPath.section];
cell.item = item;
__weak MainTableView* weakSelf = self;
cell.restBlock = ^(NSString *detailStr) {
    NSLog(@"ddff8888");
    __strong MainTableView* strongSelf = weakSelf;
    //if (strongSelf.topInsetBlock) {
        strongSelf.topInsetBlock();//ifThread 1: EXC_BAD_ACCESS (code=1, address=0x10)strongSelf.topInsetBlock();
    //}
};

return cell;

}

Ios
May.15,2021

shows that there is a problem with topInsetBlock () this block. The value is nil , and only such a piece of code is posted, and other related codes are not posted. It is difficult to judge where the specific problem lies, but it should be a problem with the definition of topInsetBlock .

Menu