Skip to content

Commit

Permalink
Improved by using makeDiskCachePath
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeDurrant committed May 20, 2015
1 parent 737140d commit d7bc2c0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions SDWebImage/SDImageCache.m
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down

0 comments on commit d7bc2c0

Please sign in to comment.