问题描述
Thread 1: EXC_BAD_ACCESS (code=1, address=0x10)
相关代码
// 请把代码文本粘贴到下方(请勿用图片代替代码)
- (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();//把if语句注释出现Thread 1: EXC_BAD_ACCESS (code=1, address=0x10)不注释的话strongSelf.topInsetBlock();不执行。我也很郁闷
//}
};
return cell;
}
说明
topInsetBlock()
这个block有问题啊,值为nil
,而且只贴了这么一段代码,其他相关的代码都没有贴出来,不好判断具体问题出在哪啊,但应该就是topInsetBlock
定义有问题