【发布时间】:2019-08-10 23:41:08
【问题描述】:
我使用下面的代码开始下载
AFURLSessionManager *downloadManager1 = [[AFURLSessionManager alloc] initWithSessionConfiguration:NSURLSessionConfiguration.defaultSessionConfiguration];
NSURLSessionDownloadTask *downloadTask;
downloadTask=[downloadManager1 downloadTaskWithRequest:request progress:nil
destination:^NSURL *(NSURL *targetPath, NSURLResponse *response){
NSURL *aURL = [[NSFileManager defaultManager] URLForDirectory:NSDocumentDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:NO error:nil];
return [aURL URLByAppendingPathComponent:[response suggestedFilename]];
}completionHandler:^(NSURLResponse *response, NSURL *filePath, NSError *error) {
}
];
[downloadTask resume];
报内存泄漏,我检查了上面的代码,没发现哪里不对,
欢迎您的评论
【问题讨论】:
标签: ios objective-c macos cocoa afnetworking