I get crash when begin download file in DownloadsViewController and then close this controller.
Example with bug - https://github.com/nullproduction/AFNetworingBug
Screen with crash - http://rghost.ru/55518252/image.png
Code:
- (void)startDownload
{
NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration];
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"https://itunesconnect.apple.com/downloads/Documentation/AppTransferTutorial.mov?itcKey=1400686864_f4496d605f190f230687304aeeff494e"]];
NSURLSessionDownloadTask *task = [manager downloadTaskWithRequest:request
progress:nil
destination:^NSURL *(NSURL *targetPath, NSURLResponse *response)
{
return nil;
}
completionHandler:^(NSURLResponse *response, NSURL *filePath, NSError *error){
}];
[task resume];
[self.progressView setProgressWithDownloadProgressOfTask:task animated:YES];
}