在block代码块中使用self报警告capturing self strongly in this block is likely to lead to a retain cycle的解决办法
来源:互联网 发布:淘宝分类在哪里设置 编辑:程序博客网 时间:2024/06/15 21:18
如上图所示:当我们在block代码块中使用self时会报一个警告意思是self本来就是strong的在block中调用会再retain一次。
解决这个警告我使用__block MyClass* myObject = self;
实现代码如下:
__block ViewController* blockSelf = self; next.NextViewControllerBlock = ^(NSString* text){ [blockSelf setLableText:text]; };
0 0
- 在block代码块中使用self报警告capturing self strongly in this block is likely to lead to a retain cycle的解决办法
- Capturing 'self' strongly in this block is likely to lead to a retain cycle
- capturing self strongly in this block is likely to lead to a retain cycle
- Capturing self strongly in this block is likely to lead to a retain cycle
- Capturing 'self' strongly in this block is likely to lead to a retain cycle
- Capturing 'self' strongly in this block is likely to lead to a retain cycle
- Capturing 'self' strongly in this block is likely to lead to a retain cycle [duplicate]
- Capturing 'self' strongly in this block is likely to lead to a retain cycle
- capturing self strongly in this block is likely to lead to a retain cycle
- Capturing 'self' strongly in this block is likely to lead to a retain cycle
- Capturing 'self' strongly in this block is likely to lead to a retain cycle [duplicate]
- Capturing self strongly in this block is likely to lead to retain cycle的问题
- Capturing 'self' strongly in this block is likely to lead to retain cycle 解决方案
- Capturing self strongly in this block is likely to lead to retain cycle解决方案
- Capturing self strongly in this block is likely to lead to retain cycle
- iOS之Block报错:capturing self strongly in this block is likely to lead to a retain cycle
- iOS之Block报错:capturing self strongly in this block is likely to lead to a retain cycle
- Captureing ‘self’ strongly in this block is likely to lead to a retain cycle 的 警告
- springMVC中调用ModelAndView.setViewName()方法不起作用,发现路径不能被改变!!
- 往自身页面提交和别处页面提交到本页的设计小技巧
- C# 3的分部方法
- PHP 时间函数介绍
- 说说linux下文件系统
- 在block代码块中使用self报警告capturing self strongly in this block is likely to lead to a retain cycle的解决办法
- JS入门
- 作业day11——集合
- StateListDrawable 按下不能自动变化的问题
- 导航条变透明,并随着屏幕上划渐渐变非透明
- PHP提交表单到当前页动作检测
- hdoj 1596 find the safest road【dijkstra】
- hdu 4393
- 102.Examine the structure of the TRANSACTIONS table: