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

决绝Capturing 'demo' strongly in this block is likely to lead to a retain cycle的更多相关文章

  1. capturing self strongly in this block is likely to lead to a retain cycle

    一个用Block实例变量语法,当有一个参考的实例变量,常引起retain cycle. capturing self strongly in this block is likely to lead ...

  2. 在block函数中规避错误信息 "capturing self strongly in this block is likely to lead to a retain cycle”

    以形如 _fontValueChangedBlock = ^(){ [self.fontSmallButton addTarget:self action:@selector(btnFontSmall ...

  3. 处理Block中的self问题(Capturing 'self' strongly in this block is likely to lead to a retain cycle)

    警告:ARC Retain Cycle Capturing 'self' strongly in this block is likely to lead to a retain cycle 代码: ...

  4. xcode arc 下使用 block警告 Capturing [an object] strongly in this block is likely to lead to a retain cycle” in ARC-enabled code

    xcode arc 下使用 block警告 Capturing [an object] strongly in this block is likely to lead to a retain cyc ...

  5. [ios2]警告:Block的Retain Cycle的解决方法 【转】

    <span style="background-color: rgb(248, 248, 248); font-family: 'PT Sans', Geogia, Baskervil ...

  6. Block的Retain Cycle的解决方法

    一个使用Block语法的实例变量,在引用另一个实例变量的时候,经常会引起retain cycle.这个问题在使ASIHTTPRequest的block语法的时候会时不时的碰到.这个问题困扰了我这个小白 ...

  7. 避免在block中循环引用(Retain Cycle in Block)

    让我们长话短说.请参阅如下代码: - (IBAction)didTapUploadButton:(id)sender { NSString *clientID = @"YOUR_CLIENT ...

  8. 写给喜欢用Block的朋友(ios Block)

    作者:fengsh998原文地址:http://blog.csdn.net/fengsh998/article/details/38090205转载请注明出处如果觉得文章对你有所帮助,请通过留言或关注 ...

  9. block没那么难(三):block和对象的内存管理

    本系列博文总结自<Pro Multithreading and Memory Management for iOS and OS X with ARC> 在上一篇文章中,我们讲了很多关于 ...

随机推荐

  1. Hadoop 之Impala

    impala 是基于hive的大数据实时分析查询引擎,直接使用Hive的元数据库metadata意味着impala元数据都存储在hive的metadstore中并且impala兼容hive的 sql解 ...

  2. java 自定义标签 传值

    <?xml version="1.0" encoding="UTF-8" ?>   <taglib xmlns="http://ja ...

  3. Svn版本控制工具的作用和应用

    一.   可解决如下问题: 1.      不小心删除了自己的项目文档和源代码文件 2.      不敢修改自己的源代码文件 3.      不知道如何把自己的项目文档传递给他人 4.      不知 ...

  4. leetcode 解题报告 Word Break

    Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separa ...

  5. log4j 配置

    给java项目添加log4j日志: 1.下载log4j jar包,放入lib目录, 导入项目中 2.创建log4j.properties 文件  目录 Src 3.在需要使用输出的类中使用 priva ...

  6. HDU 1003 动态规划

    http://acm.hdu.edu.cn/showproblem.php?pid=1003 这几天开始刷动归题目,先来一道签到题 然而做的并不轻松, 没有注意到边界问题, WA了几发才发现 #inc ...

  7. BZOJ 3736: [Pa2013]Karty

    Description 一个0/1矩阵,求能覆盖所有 \(1\) ,同时不覆盖所有 \(0\) 的矩阵,使这个面积最大. Sol DP/悬线法. 首先,所求的矩阵一定可以覆盖所有贴边的悬线. 用悬线法 ...

  8. git 使用入门篇

    最近准备给同事培训git,发现了一个不错的资源,在这里:http://www.gitguys.com/topics/creating-a-shared-repository-users-sharing ...

  9. Python统计百分比及排序

    source.txt: 60行 89 91 93 90 92 92 94 92 89 95 93 92 90 92 93 94 94 92 90 92 92 92 ... 统计各个值的百分比,并排序 ...

  10. POJ 1002

    #include <stdio.h> #include <string.h> #include <stdlib.h> struct In{ int a; ]; }p ...