我在 ios5 中使用 TWRequest,但 Leaks 报告了 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];
}];
最佳答案
您需要将 [TWRequest release];
更改为 [postRequest release];
关于iphone - TWRequest 泄漏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8054971/