Function: Help us to deal with the network Picture processing frame specially
: Https://github.com/rs/SDWebImage
1 Setting up a picture
Contains a variety of features 1,sd_setimagewithurl get network picture 2,placeholderimage placeholder picture 3,progress Download Progress Usage: nslog (@ "Download progress:%f", ( Double) receivedsize / expectedsize); 4, *image *error *imageurl, respectively, after the return of the picture, error and 5, sdimagecachetype cachetype is an enumeration type, where the picture is stored in memory, disk, or no 6,sdwebimageoptions enumeration type Usage: sdwebimageoptions options = sdwebimageretryfailed | sdwebimagelowpriority SDWebImageRetryFailed download failed repeat download common SDWebImageLowPriority Pause downloads When UI interacts common sdwebimagecachememoryonly only save pictures in memory SDWebImageProgressiveDownload You can download refresh picture SDWebImageRefreshCached Refresh cache from top to bottom like a browser sdwebimagehighpriority High priority SDWebImageDelayPlaceholder no load for bitmap &nbsP; [cell.imageview sd_setimagewithurl: (nsurl *) Placeholderimage: (uiimage *) options: (sdwebimageoptions) progress:^ (NSInteger receivedSize, nsinteger expectedsize) { < #code #> } completed:^ (UIImage *image, nserror *error, sdimagecachetype cachetype, nsurl *imageurl) { < #code #> }];2 Memory Processing
Because sdwebimgae belong to the entire project, not to a controller, so do not didreceivememorywarning in the controller to deal with memory problems, and add Applicationdidreceivememorywarning method in APPDELEGATE.M
-(void) applicationdidreceivememorywarning: (uiapplication *) application{sdwebimagemanager *MRG = [SDWebImageManager Sharedmanager]; 1, cancel the down operation [MRG Cancelall]; 2, clear the memory cache [Mrg.imagecache clearmemory];}
3 Other Features1, set periodic cleanup cache time
Set 100 days, default is 7 days [sdwebimagemanager sharedmanager].imagecache.maxcacheage = 100 * 24 * 60 * 60
2, set the maximum cache capacity
No default value, unit is unclear [sdwebimagemanager sharedmanager].imagecache.maxcachesize =;
How to use Sdwebimage