主要来看SDImageCache这个文件
@interface SDImageCache : NSObject//继承于 NSObject
FFE00A55-A431-4C91-B147-0F68A740A86B.png
有一个子类,主要是在内存警告时,调用警告函数
1CD88468-43AF-4B81-A84B-48DDF034A878.png初始化方法,内存缓存 和磁盘缓存
B6ED3933-43E9-4E10-A677-4ED020B9C622.png
发送通知这三中情况'
- (void)storeImageDataToDisk:(NSData *)imageData forKey:(NSString *)key;
存储图片
- (NSOperation *)queryDiskCacheForKey:(NSString *)key done:(SDWebImageQueryCompletedBlock)doneBlock ;
目录中查找
-(void)removeImageForKey:(NSString *)key fromDisk:(BOOL)fromDisk withCompletion:(SDWebImageNoParamsBlock)completion;
remove 缓存
其实这个文件里面主要就是这三个方法
![ ![5538E3B8-ECA6-4959-8E42-B60F8929E942.png](https://img.haomeiwen.com/i1907672/8e76de38064da6a7.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) ](https://img.haomeiwen.com/i1907672/58724751e64360c0.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
http://www.cnblogs.com/jys509/p/5199997.html
http://blog.csdn.net/l_511/article/details/48242793 (多线程相关)
网友评论