码迷,mamicode.com
首页 > 其他好文 > 详细

决绝Capturing 'demo' strongly in this block is likely to lead to a retain cycle

时间:2015-12-08 11:38:02      阅读:166      评论:0      收藏:0      [点我收藏+]

标签:

  1. - (IBAction)onTest:(id)sender  
  2. {  
  3.     BlockDemo *demo = [[BlockDemo alloc]init];  
  4.       
  5.     __weak typeof(BlockDemo) *weakDemo = demo;  
  6.       
  7.     [demo setExecuteFinished:^{  
  8.         if (weakDemo.resultCode == 200) {  
  9.             NSLog(@"call back ok.");  
  10.         }  
  11.     }];  
  12.     [demo executeTest];  
  13. }

决绝Capturing 'demo' strongly in this block is likely to lead to a retain cycle

标签:

原文地址:http://www.cnblogs.com/piaojin/p/5028557.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!