【问题标题】:How to clear cache image?如何清除缓存图像?
【发布时间】:2011-02-22 09:04:44
【问题描述】:

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

请帮帮我。

谢谢。

【问题讨论】:

    标签: iphone image caching


    【解决方案1】:

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

      【讨论】:

        猜你喜欢
        • 2013-06-23
        • 1970-01-01
        • 2017-09-18
        • 2011-04-12
        • 2011-02-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多