From d7bc2c00367d5dba4ba3d4fff47e82dde279443a Mon Sep 17 00:00:00 2001 From: Luke Durrant Date: Wed, 20 May 2015 17:30:23 +1000 Subject: [PATCH] Improved by using makeDiskCachePath --- SDWebImage/SDImageCache.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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