I have an NSURLSession that uploads multiple files. I am updating ios 7 application for ios 8. It works fine in ios 7 but when it matches ios 8 delegate meathod
URLSessionDidFinishEventsForBackgroundURLSession:
never called.
I dug a little deeper and on
-(void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didFinishDownloadingToURL:(NSURL *)location
and
-(void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error
meathods delegate I am checking the session for the remaining download tasks:
[self.session getTasksWithCompletionHandler:^(NSArray *dataTasks, NSArray *uploadTasks, NSArray *downloadTasks){ ...}
In the last delegate meathod, there is always one element that is restored in the downloadTasks array. It is strange that this download task does not always refer to the same file, and the status on these tasks indicates that the download is complete.
Again, works fine in ios7. The problem only occurs in ios 8.
ios8 nsurlsession nsurlsessiondownloadtask
nwales
source share