ARC ASIHttpRequest block时出错circle retain的问题及解决方法
2012-04-12 13:25
441 查看
在arc开发环境下用ASIHttpRequest,采用block的方式回调http响应时,会出现block will be retained by the captured object的warning.
解决方法是在声明前加__unsafe_unretained
如:
这样可以同时支持iOS4,因为iOS4不能用__weak.
reference:http://article.ityran.com/archives/1221
解决方法是在声明前加__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
相关文章推荐
- ASIHttpRequest block在ARC下使用时出错circle retain的问题及解决方法
- 升级到iOS5后ASIHttpRequest库问题及解决方法
- ASIHTTPRequest开源类项目导入问题及解决方法
- 升级到iOS5后ASIHttpRequest库问题及解决方法
- asihttprequest在arc项目里用了block出现的问题
- ASIHTTPRequest开源类项目导入问题及解决方法
- 升级到iOS5后ASIHttpRequest库问题及解决方法
- IOS5:升级到iOS5后ASIHttpRequest库问题及解决方法
- 升级到iOS5后ASIHttpRequest库问题及解决方法
- ASIHTTPRequest开源类项目导入问题及解决方法
- 升级到iOS5后ASIHttpRequest库问题及解决方法
- ASIHTTPRequest开源类项目导入问题及解决方法
- (转)升级到iOS5后ASIHttpRequest库问题及解决方法
- 升级到iOS5后ASIHttpRequest库问题及解决方法
- ASIHTTPRequest用户登陆:重复用户登陆问题解决
- ASIHTTPRequest使用过程中遇到的问题及解决办法
- 多次读取HttpServletRequest的inputstream方法 问题解决
- 使用ASIHTTPRequest 编译提示找不到"libxml/HTMLparser.h"的解决方法
- Nginx出现The plain HTTP request was sent to HTTPS port问题解决方法