Fix the getSize method which use the default file manager instead of current file manager

This commit is contained in:
DreamPiggy 2018-01-16 23:14:36 +08:00
parent 9048f3ba72
commit e9412791bd
1 changed files with 1 additions and 1 deletions

View File

@ -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];
}
});