简体   繁体   English

URLSessionDownloadTask启动时调用的委托方法是什么?

[英]What is the delegate method called when the URLSessionDownloadTask start?

There are three methods in NSURLSessionDownloadDelegate protocol. NSURLSessionDownloadDelegate协议中有三种方法。

URLSession:downloadTask:didFinishDownloadingToURL:,
URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:
URLSession:downloadTask:downloadTaskdidWriteData:totalBytesWritten:totalBytesExpectedToWrite:

The didFinishDownloadingToURL is called when the download task complete. 下载任务完成后,将调用didFinishDownloadingToURL But what is the method called when the download task start? 但是下载任务开始时调用的方法是什么?

URLSession:downloadTask:downloadTaskdidWriteData:totalBytesWritten:totalBytesExpectedToWrite: this delegate gets called time to time depending on data received, this delegates writes data to file location. URLSession:downloadTask:downloadTaskdidWriteData:totalBytesWritten:totalBytesExpectedToWrite:根据接收到的数据,此委托会不时被调用,此委托会将数据写入文件位置。 furthermore, if anything goes wrong, –URLSession:task:didCompleteWithError: this delegate gives you details about the error. 此外,如果发生任何错误,–URLSession:task:didCompleteWithError:此委托为您提供有关错误的详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM