Capturing 'self' strongly in this block is likely to lead to a retain cycle
代码中写了self,然后xcode给出这样的提示。
1.
__block ViewController *strongSelf = self;
2.
将self修改为:strongSelf
3.举例说明:
__block PracticeWriteUIView *strongSelf = self;// 上面步骤1
[_bv4_describleDo addTargetForControlEvents:UIControlEventTouchUpInside action:^(id sender) {
[strongSelf->_collectionViewNow scrollToItemAtIndexPath:1];// 上面步骤2(只是把之前用self改为了strongSelf)
}];
参考文档:
https://blog.csdn.net/grl18840839630/article/details/81235089