Closed avaiyakirtib closed 9 years ago
i have resolved the issue by modifying below code
(void)addDownloadTask:(NSString )fileName fileURL:(NSString )fileURL { // replace sessionmanage object and its part as below NSURLSessionDownloadTask *downloadTask =nil;
NSURLSessionConfiguration sessionConfiguration = [NSURLSessionConfiguration defaultSessionConfiguration]; NSURLSession * session = [NSURLSession sessionWithConfiguration:sessionConfiguration delegate:self delegateQueue:[NSOperationQueue mainQueue]] ; NSURLRequest request = [NSURLRequest requestWithURL:url];
downloadTask = [session downloadTaskWithRequest:request]; }
Done
Fixed.
I am using this class for downloading of more than 100 PDFs at a time by using addtask delegate method of MZDownloadManager , But after 2-3 times of exceution its getting below error and my app goes to be crushed * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* setObjectForKey: object cannot be nil (key: downloadTask)'
and for low number of PDFs its working fine , can you please suggest the solution ? I hav tried with dispatch_queus but its not working