5
使用TWRequest時,Instruments(泄漏)報告內存泄漏,我無法真正看到我在做什麼錯誤。在非ARC項目中使用TWRequest似乎泄漏
下面是重現該問題的步驟:
創建一個新的Xcode項目(ARC禁用),將下列行添加Twitter的框架,然後只需添加到代碼中(例如,在viewDidLoad中):
TWRequest *postRequest = [[TWRequest alloc] initWithURL:[NSURL URLWithString:@"http://api.twitter.com/1/statuses/public_timeline.json"] parameters:nil requestMethod:TWRequestMethodGET];
[postRequest performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) {
NSLog(@"in performrequest");
[postRequest release];
}];
繪製與儀器(泄漏)此代碼後,它告訴我,以「performRequestWithHandler」行泄漏:
任何想法如何防止此泄漏?
我發現了一個類似的問題here,但它似乎與我描述的問題無關。