美文网首页
block循环引用释放不掉界面(dealloc不执行)

block循环引用释放不掉界面(dealloc不执行)

作者: coding_Liu | 来源:发表于2020-09-23 17:35 被阅读0次
@interface XEditorAnswerDetailView ()<UITableViewDelegate,UITableViewDataSource>
{
    XEditorCommentEntity *commentModel;
}
@property (nonatomic, strong) UITableView *answerTableView;
@property (nonatomic, strong) UIImageView *tabHeaderImageView;

上面
{
属性!!!
}

cell.answerToAnswerBlock = ^{
__strong typeof(weakSelf)self = weakSelf;
//BOOL isSelf = [weakCell.answerContentLabel.text hasPrefix:@"我"];
if (self.delegate && [self.delegate respondsToSelector:@selector(answerToAnswerWithAuthor:insertIdx:)]) {
[self.delegate answerToAnswerWithAuthor:⚠️_commentModel ⚠️ insertIdx:indexPath.row];
}
};

会造成循环引用

相关文章

网友评论

      本文标题:block循环引用释放不掉界面(dealloc不执行)

      本文链接:https://www.haomeiwen.com/subject/awpoyktx.html