【发布时间】:2015-01-28 04:12:39
【问题描述】:
我有一个 UIWebView 可以从这样的请求中加载页面
NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:addressUrl cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:30];
[self.webView loadRequest:req];
然后我必须重新加载页面,但它重新加载了相同的页面,它并没有真正重新加载页面。它使用某种缓存。
我还会在重新加载 URL 之前清理所有缓存
[[NSURLCache sharedURLCache] setDiskCapacity:0];
[[NSURLCache sharedURLCache] setMemoryCapacity:0];
[[NSURLCache sharedURLCache] removeAllCachedResponses];
NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
NSArray *cookies = [cookieStorage cookies];
for (NSHTTPCookie *cookie in cookies) {
[cookieStorage deleteCookie:cookie];
}
有什么帮助吗?
【问题讨论】:
-
我也有同样的问题...如果有人指导就好了..
标签: ios uiwebview reload nsurlcache