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];
}];
我很驚訝這個工程:[TWRequest發佈]泄漏是否告訴你哪條線路泄漏? –
您可以發送給「NSObject」實例的任何消息,也可以發送給某個類。 '[TWRequest發佈];'不會做任何事情,但是「起作用」。 – hypercrypt
在Xcode中運行分析,它可能會顯示錯誤。 – zaph