3
我已經使用Three20包創建縮略圖視圖。我已成功加載並在視圖中顯示圖像。現在我想清除緩存圖像,因爲每次只顯示先前緩存的圖像而不顯示更新或最新的圖像。所有圖像都從RSS提要中檢索。如何清除緩存圖片?
請幫我一把。
謝謝。
我已經使用Three20包創建縮略圖視圖。我已成功加載並在視圖中顯示圖像。現在我想清除緩存圖像,因爲每次只顯示先前緩存的圖像而不顯示更新或最新的圖像。所有圖像都從RSS提要中檢索。如何清除緩存圖片?
請幫我一把。
謝謝。
[[TTURLCache sharedCache] removeAll:YES];
?
這裏有一對夫婦更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"];