【问题现象】
在block块中使用self时报警告:self strongly in this block is likely to lead to a retain cycle
【问题解决】
__block ViewController *blockSelf = self;
_block = ^{
[blockSelf->_items addObject:@"Hello!"];
};
时间: 2024-10-14 20:03:25
【问题现象】
在block块中使用self时报警告:self strongly in this block is likely to lead to a retain cycle
【问题解决】
__block ViewController *blockSelf = self;
_block = ^{
[blockSelf->_items addObject:@"Hello!"];
};