I have NSURLSession that is downloading multiple files. I'm updating an ios 7 application for ios 8. It works fine in ios 7, but when complied against ios 8 The delegate meathod
URLSessionDidFinishEventsForBackgroundURLSession:
is never called.
I dug a little deeper and on the
-(void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didFinishDownloadingToURL:(NSURL *)location
and
-(void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error
delegate meathods I am checking the session for the remaining download tasks:
[self.session getTasksWithCompletionHandler:^(NSArray *dataTasks, NSArray *uploadTasks, NSArray *downloadTasks){ ...}
On the last delegate meathod called there is always one element remaning in the downloadTasks array. What is strange is that this download task is not always referencing the same file, and the status on that tasks shows that the download is complete.
Again, works fine in ios7. Problem occurs in ios 8 only.