Authored by Olivier Poitrey

Add SDImageCache removeImageForKey:fromDisk: to allow cache item removal from memory only (fix #111)

... ... @@ -25,6 +25,7 @@
- (void)queryDiskCacheForKey:(NSString *)key delegate:(id <SDImageCacheDelegate>)delegate userInfo:(NSDictionary *)info;
- (void)removeImageForKey:(NSString *)key;
- (void)removeImageForKey:(NSString *)key fromDisk:(BOOL)fromDisk;
- (void)clearMemory;
- (void)clearDisk;
- (void)cleanDisk;
... ...
... ... @@ -298,13 +298,22 @@ static SDImageCache *instance;
- (void)removeImageForKey:(NSString *)key
{
[self removeImageForKey:key fromDisk:YES];
}
- (void)removeImageForKey:(NSString *)key fromDisk:(BOOL)fromDisk
{
if (key == nil)
{
return;
}
[memCache removeObjectForKey:key];
[[NSFileManager defaultManager] removeItemAtPath:[self cachePathForKey:key] error:nil];
if (fromDisk)
{
[[NSFileManager defaultManager] removeItemAtPath:[self cachePathForKey:key] error:nil];
}
}
- (void)clearMemory
... ...