首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >TWRequest泄露?

TWRequest泄露?
EN

Stack Overflow用户
提问于 2011-11-09 01:58:36
回答 1查看 526关注 0票数 3

Im在ios5中使用TWRequest,但Leaks报告了TWRequest的内存泄漏。

我正在做这样的事情,我是不是做错了什么?

代码语言:javascript
复制
TWRequest *postRequest = [[TWRequest alloc] initWithURL:[NSURL URLWithString:@"http://api.twitter.com/1/friendships/create.json"] parameters:[NSDictionary dictionaryWithObject:@"auser"  forKey:@"screen_name"] requestMethod:TWRequestMethodPOST];

 // Set the account used to post the tweet.
 [postRequest setAccount:twitterAccount];

 // Perform the request created above and create a handler block to handle the response.
 [postRequest performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) {
       NSString *output = [NSString stringWithFormat:@"HTTP response status: %i", [urlResponse statusCode]];

       [TWRequest release];
 }];
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-11-09 02:02:05

您需要将[TWRequest release];更改为[postRequest release];

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8054971

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档