Im在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];
}];发布于 2011-11-09 02:02:05
您需要将[TWRequest release];更改为[postRequest release];
https://stackoverflow.com/questions/8054971
复制相似问题