TWRequest подтекает? - PullRequest
       4

TWRequest подтекает?

3 голосов
/ 08 ноября 2011

Я использую TWRequest в ios5, но 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];
 }];

1 Ответ

2 голосов
/ 08 ноября 2011

Вы хотите изменить [TWRequest release]; на [postRequest release];

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...