Uiimageview * img = [[Uiimageview alloc]initwithframe:cgrectmake (100, 100, 100, 100)];
[Self.view addsubview:img];
Nsurl *url = [Nsurl urlwithstring:@ ""];
Three ways:
1. Direct load (cache address)
[img Sd_setimagewithurl:url];
2, two processes. Start loading, loading complete
NSLog (@ "Start loading");
[img Sd_setimagewithurl:url completed:^ (UIImage * image, Nserror * ERRPR, sdimagecachetype cachetype,nsurl * IamgeURL) {
NSDate * senddate=[nsdate Date];
NSLog (@ "%@", senddate);
NSLog (@ "load complete");
}];
3. Load the local picture first, then load the network picture
UIImage * Image =[uiimage imagenamed:@ "green.jpg"];
[img Sd_setimagewithurl:url placeholderimage:image];
Get Cache (All pictures)
int size = [[Sdimagecache shareimagecache]getsize];
Clear cache (All pictures)
[[Sdimagecache Shareimagecache]cleardisk]
Lan Yi Education Sdwebimage Framework