本文介绍了TWRequest泄漏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Im using TWRequest in ios5 but Leaks is reporting a memory leak for TWRequest.

我正在做这样的事情,我在某个地方出错了?

I'm doing something like this, am I going wrong somewhere?

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];
 }];


推荐答案

你想要改变 [TWRequest release]; to [postRequest release];

这篇关于TWRequest泄漏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-15 05:15