zoukankan      html  css  js  c++  java
  • ios NSURLSession completeHandler默认调用quque

    注意 ,

    [[NSURLSession sharedSession] dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error)

    这种方法用了默认配置,那么completeHanlder不会在mainQueue中执行,看下面的官方文档:

    A queue for scheduling the delegate calls and completion handlers. If nil, the session creates a serial operation queue for performing all delegate method calls and completion handler calls.

    这样的结果就是completeHandler不在主线程执行(100%?),而是在子线程中执行。

  • 相关阅读:
    HDU
    POJ
    快速幂运算
    RocketMQ集群
    RocketMQ角色介绍
    RocketMQ初探
    MySQL 串行隔离级别小记
    分布式事务笔记
    MySQL分库分表篇
    MySQL主从篇
  • 原文地址:https://www.cnblogs.com/breezemist/p/4663800.html
Copyright © 2011-2022 走看看