Merge pull request #2173 from imryan/patch-1

Added missing param in storeImage examples
This commit is contained in:
DreamPiggy 2018-01-14 18:12:19 +08:00 committed by GitHub
commit 44aa6d513f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -115,14 +115,16 @@ SDImageCache *imageCache = [[SDImageCache alloc] initWithNamespace:@"myNamespace
By default SDImageCache will lookup the disk cache if an image can't be found in the memory cache.
You can prevent this from happening by calling the alternative method `imageFromMemoryCacheForKey:`.
To store an image into the cache, you use the storeImage:forKey: method:
To store an image into the cache, you use the storeImage:forKey:completion: method:
```objective-c
[[SDImageCache sharedImageCache] storeImage:myImage forKey:myCacheKey];
[[SDImageCache sharedImageCache] storeImage:myImage forKey:myCacheKey completion:^{
// image stored
}];
```
By default, the image will be stored in memory cache as well as on disk cache (asynchronously). If
you want only the memory cache, use the alternative method storeImage:forKey:toDisk: with a negative
you want only the memory cache, use the alternative method storeImage:forKey:toDisk:completion: with a negative
third argument.
### Using cache key filter
@ -144,4 +146,4 @@ the URL before to use it as a cache key:
// Your app init code...
return YES;
}
```
```