iphone - TWRequest 泄漏?

标签 iphone objective-c ios5

我在 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/

相关文章:

iphone - 获取随机 NSDictionary 键?

ios - 在带有桥头的 Swift 中使用 XLForm

iphone - 在 UIStoryboard 的 UITabBarController 中配置 UIImagePickerController

iPhone iOS5 CLGeocoder 如何对一大组(200)地址进行地理编码?

ios - 如何在 IOS 中使用 UIView 打开 PDF 文件

ios - 如何编辑亮度、对比度和饱和度并为已创建的保存在库中的视频添加字幕?

iphone - 将照片库 URL 保存为 NSString 然后返回 URL

iphone - iOS 7 图标文件名

iphone - NSLog 会影响应用程序的速度吗?

iphone - 单击按钮时隐藏显示 UIPicker