mzeeshanid / MZDownloadManager

This download manager uses NSURLSession api to download files. It can download multiple files at a time. It can download large files if app is in background. It can resume downloads if app was quit.
BSD 3-Clause "New" or "Revised" License
1.12k stars 238 forks source link

Get crushed with error message setObjectForKey: object cannot be nil (key: downloadTask) #10

Closed avaiyakirtib closed 9 years ago

avaiyakirtib commented 9 years ago

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

avaiyakirtib commented 9 years ago

i have resolved the issue by modifying below code

Done

mzeeshanid commented 9 years ago

Fixed.