When called, cancelByResumingData:it will create resumeData, and right after that it will call URLSessionTask-didCompleteWithError. There we set a flag to detect where the application is paused or not, and we can save resumeDatawithout canceling the download.
, :
self.downloadTask = [self.session downloadTaskWithResumeData: objFile.resumeData];
[self.downloadTask resume];