Improved by using makeDiskCachePath

This commit is contained in:
Luke Durrant 2015-05-20 17:30:23 +10:00
parent 737140d4cb
commit d7bc2c0036
1 changed files with 4 additions and 4 deletions

View File

@ -84,8 +84,8 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) {
}
- (id)initWithNamespace:(NSString *)ns {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
return [self initWithNamespace:ns diskCacheDirectory:paths[0]];
NSString *path = [self makeDiskCachePath:ns];
return [self initWithNamespace:ns diskCacheDirectory:path];
}
- (id)initWithNamespace:(NSString *)ns diskCacheDirectory:(NSString *)directory {
@ -112,8 +112,8 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) {
}
else
{
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
_diskCachePath = [paths[0] stringByAppendingString:fullNamespace];
NSString *path = [self makeDiskCachePath:ns];
_diskCachePath = path;
}
// Set decompression to YES