Remove UIWebView's internal cache

前端 未结 2 1078
执念已碎
执念已碎 2020-12-09 18:06

I\'m showing a web app in an UIWebView, and sometimes the content of pages will change. After content have been changed the app clears the cache. But when I go

2条回答
  •  囚心锁ツ
    2020-12-09 19:04

    I had the same issue and setting HTTPShouldHandleCookies property to NO fixed my problem.

    For example:

    NSMutableURLRequest  *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:strurl]];
    
    [request setHTTPShouldHandleCookies:NO];
    
    [webView loadRequest: request];
    

    Hope this help.

提交回复
热议问题