llyouss
llyouss
新版已弃用,使用 NSURLRequest 缓存策略;参考代码 //加载网页 [webView loadRequestURL:[NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://www.sina.cn"] cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:20.0f]]; //缓存沿用了 NSURLRequest 的缓存机制,用户可以自定义设置; typedef NS_ENUM(NSUInteger, NSURLRequestCachePolicy) { NSURLRequestUseProtocolCachePolicy = 0, //默认的缓存策略 NSURLRequestReloadIgnoringLocalCacheData = 1, //忽略缓存,从服务端加载数据; NSURLRequestReloadIgnoringLocalAndRemoteCacheData = 4, // Unimplemented...
使用单例时,使用封装的api加载网页,在出现网页缓慢,webview将还会展示上一次打开的网页界面,此时给网页加载个空白页更符合用户体验。about:blank;在iphone6下面测试不理想,后续更新代码!
工程是demo吗?
之前没更新demo,你现在试试。
You can use the api setcookie:(NSHTTPCookie *)cookie, but the cookies must be with expiresDate and domain.Following,other cookies will be save in cache automatically.
open the cache,openCache = YES;
I love Aamir Khan!
已解决,重新下载看看!