AFNetworking 2.x网络调用时序图
AFNetworking 2.x中,关于网络请求的并发是通过NSOperation&NSOperationQueue实现的。
- 网络调用相关封装在NSOperation的子类
AFURLConnectionOperation中。 - 类
AFHTTPRequestOperationManager通过NSOperationQueue完成对AFURLConnectionOperation的调度,当AFURLConnectionOperation一旦被加入到NSOperationQueue中,就开始了对网络并发执行. AFURLConnectionOperation可以通过调用start方法单独执行,此时和NSOperationQueue无关的。
