如何清除缓存图片?

3
我使用Three20 bundle创建了缩略图视图。我成功地加载和显示了视图中的图像。现在,我想清除缓存中的图像,因为每次它只显示先前缓存的图像,而不是更新或最新的图像。所有图像都从RSS源中检索。

请帮帮我。

谢谢。

2个回答

3

[[TTURLCache sharedCache] removeAll:YES];?


2
这里有几个TTURLCache的方法,如果你不想清空整个缓存,可以使用它们:
[[TTURLCache sharedCache] removeURL:@"documents://an_image.jpg" fromDisk:YES];
[[TTURLCache sharedCache] invalidateURL:@"documents://an_image.jpg"];

或者

[[TTURLCache sharedCache] removeURL:@"http://example.com/an_image.jpg" fromDisk:YES];
[[TTURLCache sharedCache] invalidateURL:@"http://example.com/an_image.jpg"];

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接