• NSURLSession各文件关系


    NSURLSession   通过session创建任务

    @property (class, readonly, strong) NSURLSession *sharedSession; 

    + (NSURLSession *)sessionWithConfiguration:(NSURLSessionConfiguration *)configuration;

    + (NSURLSession *)sessionWithConfiguration:(NSURLSessionConfiguration *)configuration delegate:(nullable id <NSURLSessionDelegate>)delegate delegateQueue:(nullable NSOperationQueue *)queue;

    @property (readonly, retain) NSOperationQueue *delegateQueue;

    @property (nullable, readonly, retain) id <NSURLSessionDelegate> delegate;

    @property (readonly, copy) NSURLSessionConfiguration *configuration;

    @property (nullable, copy) NSString *sessionDescription;

    - (void)finishTasksAndInvalidate;

    - (void)invalidateAndCancel;

    - (void)resetWithCompletionHandler:(void (^)(void))completionHandler;   

    - (void)flushWithCompletionHandler:(void (^)(void))completionHandler;  

    - (void)getTasksWithCompletionHandler:(void (^)(NSArray<NSURLSessionDataTask *> *dataTasks, NSArray<NSURLSessionUploadTask *> *uploadTasks, NSArray<NSURLSessionDownloadTask *> *downloadTasks))completionHandler; 

    - (void)getAllTasksWithCompletionHandler:(void (^)(NSArray<__kindof NSURLSessionTask *> *tasks))completionHandler API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0)); /* invokes completionHandler with all outstanding tasks.

    - (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request;

    - (NSURLSessionDataTask *)dataTaskWithURL:(NSURL *)url;

    - (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request fromFile:(NSURL *)fileURL;

    - (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request fromData:(NSData *)bodyData;

    - (NSURLSessionUploadTask *)uploadTaskWithStreamedRequest:(NSURLRequest *)request;

     - (NSURLSessionDownloadTask *)downloadTaskWithRequest:(NSURLRequest *)request;

    - (NSURLSessionDownloadTask *)downloadTaskWithURL:(NSURL *)url;

    - (NSURLSessionDownloadTask *)downloadTaskWithResumeData:(NSData *)resumeData;

    - (NSURLSessionStreamTask *)streamTaskWithHostName:(NSString *)hostname port:(NSInteger)port API_AVAILABLE(macos(10.11), ios(9.0), tvos(9.0)) __WATCHOS_PROHIBITED;

    - (NSURLSessionStreamTask *)streamTaskWithNetService:(NSNetService *)service API_AVAILABLE(macos(10.11), ios(9.0), tvos(9.0)) __WATCHOS_PROHIBITED;

    NSURLSessionConfiguration 通过configuration创建session

    NSURLSessionTask   任务

    NSURLSessionDataTask : NSURLSessionTask  普通任务

    NSURLSessionUploadTask : NSURLSessionDataTask 上传任务

    NSURLSessionDownloadTask : NSURLSessionTask  下载任务

    NSURLSessionStreamTask : NSURLSessionTask

     

    NSURLSessionDelegate  session代理

    NSURLSessionTaskDelegate <NSURLSessionDelegate>

     

    NSURLSessionDataDelegate <NSURLSessionTaskDelegate>

    NSURLSessionDownloadDelegate <NSURLSessionTaskDelegate>

    NSURLSessionStreamDelegate <NSURLSessionTaskDelegate>

  • 相关阅读:
    Android Studio下载gradle失败
    【宁熙】回望四月又七天
    caffe crnn windows上编译多标签分类版本
    图像识别方案的选择思考
    使用SVM进行图像识别的一些思考
    安卓usb串口免root调试
    交叉编译opencv移植到海思3518
    【2021-10-24】连岳摘抄
    【2021-10-23】人间词话
    【2021-10-22】梅兰芳
  • 原文地址:https://www.cnblogs.com/yang-shuai/p/7872023.html
Copyright © 2020-2023  润新知