Tag:run header set Callback emc memcach query mutable return
Flowchart: 1.uiimageview + Webcache class sd_setimagewithurl method for loading images asynchronously. in the classification, implement the Sd_imageurl property and save the URL. Placeholder is paid to Image2. Sdwebimagemanager (simple interest), call the Downloadimagewithurl method to verify that the URL is nsstring nsurl and convert. Create a Sdwebimagecombinedoperation object to verify that the Self.failedurls contains a series of judgements such as null Url,url. Self.runningoperations add url 3. Sdimagecache Object (property) calls the querydiskcacheforkey method, the parameter key (URL to string), callback block. With the library key in the Memcache (Nscache) attribute, whether it contains image if the H cache does not have an asynchronous thread, go to the sandbox to find, if found, extract and convert to image. Then deposit into the Memcache attribute. UIView + webcacheoperation category, Operationdictionary attribute, deposit uiimageviewimageload = "< Sdwebimagecombinedoperation:0x600000029e40> " 4. After the sandbox executes, callback block (Sdwebimagemanager). The Downloadimagewithurl method for prioritizing calls to the Imagedownloader (Sdwebimagedownloader) property, parameter Url,options,progress,completedblock, The F return value is the Sdwebimagedownloaderoperation class that encapsulates the request calls Addprogresscallback one (dispatch_barrier_sync) Sync Dim , self in the thread that you are starting. The Urlcallbacks property is used to store Completedblock (Sdwebimagedownloadercompletedblock). Set upTimeout, if not set, default 15s, then encapsulate nsmutableurlrequest request Network, stitching parameters (cookies,headerd, etc.), operation Priority, Shoulddecompressimages properties and so on. The Downloadqueue (Nsoperationqueue) property adds a Initwithrequest method that operation calls the Sdwebimagedownloaderoperation object, which is used for downloading. After c initializes the Sdwebimagedownloaderoperation class, add operation to Nsoperationqueue, [wself.downloadqueue addoperation:operation]; then calls the Start method in the Sdwebimagedownloaderoperation class (the overridden Nsoperation-start) Z Knowledge Point: 1. Dispatch_barrier_sync
- Nsoperation
The role of the class and its relationship:
8 Sdwebimage Process