3

Im using TWRequest in ios5 but Leaks is reporting a memory leak for TWRequest.

I'm doing something like this, am I going wrong somewhere?

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];
 }];
hypercrypt
  • 15,389
  • 6
  • 48
  • 59
cal
  • 470
  • 1
  • 7
  • 27

1 Answers1

2

You'll want to change [TWRequest release]; to [postRequest release];

hypercrypt
  • 15,389
  • 6
  • 48
  • 59