ARC ASIHttpRequest block时出错circle retain的问题及解决方法
来源:互联网 发布:中国历年石油进口数据 编辑:程序博客网 时间:2024/04/29 20:00
在arc开发环境下用ASIHttpRequest,采用block的方式回调http响应时,会出现block will be retained by the captured object的warning.
解决方法是在声明前加__unsafe_unretained
如:
NSURL *url = [NSURL URLWithString:WEB_SERVICE];__unsafe_unretained __block ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
这样可以同时支持iOS4,因为iOS4不能用__weak.
reference:http://article.ityran.com/archives/1221
- ARC ASIHttpRequest block时出错circle retain的问题及解决方法
- ASIHttpRequest block在ARC下使用时出错circle retain的问题及解决方法
- asihttprequest在arc项目里用了block出现的问题
- Block的Retain Cycle的解决方法
- 警告:Block的Retain Cycle的解决方法
- 警告:Block的Retain Cycle的解决方法
- Block的Retain Cycle的解决方法
- Block的Retain Cycle的解决方法
- 警告:Block的Retain Cycle的解决方法
- 警告:Block的Retain Cycle的解决方法
- 警告:Block的Retain Cycle的解决方法
- Block的Retain Cycle的解决方法
- ASIHTTPRequest开源类项目导入问题及解决方法
- ASIHTTPRequest开源类项目导入问题及解决方法
- ASIHTTPRequest开源类项目导入问题及解决方法
- Block的Retain Cycle的解决方法 (dealloc不掉用)
- [ios2]警告:Block的Retain Cycle的解决方法 【转】
- Block的引用循环问题 (ARC & non-ARC)
- cocos2d四个基本概念
- 代码调试
- 武汉的雨天
- 解决执行Oracle控制脚本时遇到的 “cat: /etc/oratab: 没有那个文件或目录”的问题
- Android中DrawBitmapMesh用法小记
- ARC ASIHttpRequest block时出错circle retain的问题及解决方法
- 内核空间!=内核进程
- NTSYSAPI NTSTATUS NTAPI
- 值得一看的聊天技巧
- Linux Yum用法小结
- 哪本书是对程序员最有影响、每个程序员都该阅读的书?
- 正则表达式
- div+css实战演练---优酷盒子模型和搜狐首页面布局效果
- 表空间命令