如何在iOS中清除Web缓存

时间:2013-11-05 12:27:35

标签: ios caching

我尝试了以下方式:

  [[NSURLCache sharedURLCache] removeAllCachedResponses];
    [[NSURLCache sharedURLCache] setDiskCapacity:0];
    [[NSURLCache sharedURLCache] setMemoryCapacity:0];

它会清除cache.db,但它仍在内存中。 它不会永久删除它。

我能够通过"字符串"

来阅读它

有人知道如何在iOS中清除cache.db(实用)

1 个答案:

答案 0 :(得分:0)

试试这个,

NSURLCache *sharedCache = [[NSURLCache alloc] initWithMemoryCapacity:0 diskCapacity:0 diskPath:nil];
[NSURLCache setSharedURLCache:sharedCache];