diff --git a/SDWebImage/SDImageCache.m b/SDWebImage/SDImageCache.m index af7bcd28d..26afdb332 100644 --- a/SDWebImage/SDImageCache.m +++ b/SDWebImage/SDImageCache.m @@ -84,8 +84,8 @@ - (id)init { } - (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 @@ - (id)initWithNamespace:(NSString *)ns diskCacheDirectory:(NSString *)directory } else { - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); - _diskCachePath = [paths[0] stringByAppendingString:fullNamespace]; + NSString *path = [self makeDiskCachePath:ns]; + _diskCachePath = path; } // Set decompression to YES