2010-05-21 88 views
3

我已经使用Three20包创建缩略图视图。我已成功加载并在视图中显示图像。现在我想清除缓存图像,因为每次只显示先前缓存的图像而不显示更新或最新的图像。所有图像都从RSS提要中检索。如何清除缓存图片?

请帮我一把。

谢谢。

回答

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"];