Merge pull request #2180 from dreampiggy/fix_cache_get_size_file_manager
Fix the getSize method which use the default file manager instead of current file manager
This commit is contained in:
commit
ccca6184d3
|
@ -588,7 +588,7 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) {
|
|||
NSDirectoryEnumerator *fileEnumerator = [_fileManager enumeratorAtPath:self.diskCachePath];
|
||||
for (NSString *fileName in fileEnumerator) {
|
||||
NSString *filePath = [self.diskCachePath stringByAppendingPathComponent:fileName];
|
||||
NSDictionary<NSString *, id> *attrs = [[NSFileManager defaultManager] attributesOfItemAtPath:filePath error:nil];
|
||||
NSDictionary<NSString *, id> *attrs = [_fileManager attributesOfItemAtPath:filePath error:nil];
|
||||
size += [attrs fileSize];
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue