SDWebImage 学习一

本文介绍了SDWebImage中关于请求管道使用及URL枚举器的相关知识。讲解了HTTPShouldUsePipelining属性的作用,即允许在未响应时进行新的请求,但依赖服务器按顺序响应。同时,文章还探讨了enumeratorAtURL方法,用于从指定URL获取目录枚举器,用于预加载和缓存资源属性。
摘要由CSDN通过智能技术生成

知识点

1 dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL)

strcmp()

#ifndef dispatch_main_async_safe
#define dispatch_main_async_safe(block)\
    if (strcmp(dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL), dispatch_queue_get_label(dispatch_get_main_queue())) == 0) {\
        block();\
    } else {\
        dispatch_async(dispatch_get_main_queue(), block);\
    }
#endif
  1. strcmp()是c语言的字符串比较函数. strcmp(s1,s2) 判断两个字符串s1和s2是否相同,相同返回true ,不同返回false
  2. dispatch_queue_get_label 传入DISPATCH_CURRENT_QUEUE_LABEL会返回当前队列.
  3. 如果是在主线程直接回调, 如果不是主线程, 异步回到主线程.
2

dispatch_get_current_queue

查看原文
Use the dispatch_get_current_queue function for debugging purposes or to test the identity of the current queu

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值