What is difference between NSURLSessionDataTask vs NSURLSessionDownloadTask

后端 未结 5 488
执念已碎
执念已碎 2020-12-29 21:03

In latest apple introduce new NSURLSession in replace of NSURLConnection, so in there are different task , so what is the difference between

5条回答
  •  隐瞒了意图╮
    2020-12-29 21:30

    We can get it from header files

    /* * An NSURLSessionDataTask does not provide any additional * functionality over an NSURLSessionTask and its presence is merely * to provide lexical differentiation from download and upload tasks. */

    @interface NSURLSessionDataTask : NSURLSessionTask
    @end
    

    /* * An NSURLSessionUploadTask does not currently provide any additional * functionality over an NSURLSessionDataTask. All delegate messages * that may be sent referencing an NSURLSessionDataTask equally apply * to NSURLSessionUploadTasks. */

    @interface NSURLSessionUploadTask : NSURLSessionDataTask
    @end
    

    /* * NSURLSessionDownloadTask is a task that represents a download to * local storage. */

    @interface NSURLSessionDownloadTask : NSURLSessionTask
    

提交回复
热议问题