Fix the getSize method which use the default file manager instead of current file manager
This commit is contained in:
parent
9048f3ba72
commit
e9412791bd
|
@ -588,7 +588,7 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) {
|
||||||
NSDirectoryEnumerator *fileEnumerator = [_fileManager enumeratorAtPath:self.diskCachePath];
|
NSDirectoryEnumerator *fileEnumerator = [_fileManager enumeratorAtPath:self.diskCachePath];
|
||||||
for (NSString *fileName in fileEnumerator) {
|
for (NSString *fileName in fileEnumerator) {
|
||||||
NSString *filePath = [self.diskCachePath stringByAppendingPathComponent:fileName];
|
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];
|
size += [attrs fileSize];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue