Ich möchte die Größe von Speichercache und Plattencache für SDImageCache begrenzen. Unten ist der Code, den ich für den Download der Bilder verwendet habe. Standardmäßig speichert es die Bilder im Cache und ist im Bibliotheksordner der Sandbox vorhanden.So begrenzen Sie die Größe des Platten- und Speichercaches von SDImageCache
meine Anwendung ID/Library/Caches/com.hackemist.SDWebImageCache.default/
#import <SDWebImage/UIImageView+WebCache.h>
...
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *MyIdentifier = @"MyIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:MyIdentifier] autorelease];
}
// Here we use the new provided sd_setImageWithURL: method to load the web image
[cell.imageView sd_setImageWithURL:[NSURL URLWithString:@"http://www.domain.com/path/to/image.jpg"]
placeholderImage:[UIImage imageNamed:@"placeholder.png"]];
cell.textLabel.text = @"My Text";
return cell;
}
Gibt es eine andere Methode? – Burak