1. NSCache 和 NSMutableDictionary 比较
用法基本类似只是NSCache 并没有像字典那样的操作
[self.imageCache setObject:image forKey:URLStr];
2. 当对 NSCache removeAllObject 之后会出现无法再次赋值的问题
解决办法
运用 dispatch_once 方法延迟一秒执行清理操作即可
-(void)clearMemoryCache dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [self.imageCache removeAllObjects];
});
}