2011-11-08 27 views
3

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

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

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

我很惊讶这个工程:[TWRequest发布]泄漏是否告诉你哪条线路泄漏? –

+0

您可以发送给“NSObject”实例的任何消息,也可以发送给某个类。 '[TWRequest发布];'不会做任何事情,但是“起作用”。 – hypercrypt

+0

在Xcode中运行分析,它可能会显示错误。 – zaph

回答

2

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

+0

啊,是的,我怎么错过了,谢谢。 – cal