uiweb实现缓存
来源:互联网 发布:淘宝网购买泓铭软件 编辑:程序博客网 时间:2024/06/07 01:22
NSURL *url = [NSURL URLWithString:@"http://www.baidu.com/"];
NSURLCache *urlCache = [NSURLCache sharedURLCache];
[urlCache setMemoryCapacity:1*1024*1024];
NSMutableURLRequest *urlRequest=[NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData timeoutInterval:60.0];
NSCachedURLResponse *response=[urlCache cachedResponseForRequest:urlRequest];
UIWebView *web = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
if (response !=nil ) {
[urlRequest setCachePolicy:NSURLRequestReturnCacheDataDontLoad];
}else
{
}
[web loadRequest:urlRequest];
[self.view addSubview:web];
NSURLCache *urlCache = [NSURLCache sharedURLCache];
[urlCache setMemoryCapacity:1*1024*1024];
NSMutableURLRequest *urlRequest=[NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData timeoutInterval:60.0];
NSCachedURLResponse *response=[urlCache cachedResponseForRequest:urlRequest];
UIWebView *web = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
if (response !=nil ) {
[urlRequest setCachePolicy:NSURLRequestReturnCacheDataDontLoad];
}else
{
}
[web loadRequest:urlRequest];
[self.view addSubview:web];
0 0
- uiweb实现缓存
- UIWeb 禁用手势
- saltstack web uiweb平台界面
- iOS UIWeb与JS之间的交互
- 缓存实现
- 实现缓存 java实现
- PHP缓存的实现
- 实现缓存后替换
- 对象缓存 类实现
- PetShop缓存的实现
- 实现ASP缓存技术
- PHP缓存的实现
- PHP缓存的实现
- PHP缓存的实现
- 缓存实现静太化
- JAVA实现分布式缓存
- php 实现查询缓存
- JAVA缓存的实现
- Unity3D 旋转天空盒的方法
- 海豚蓝牙ASIO驱动程序使用说明
- 好久没来了,测试一下现在的博客
- PHP实现冒泡排序和快速排序
- 函数的传入和传出参数
- uiweb实现缓存
- 自定义拦截器分析
- 笔记
- java常见的120道面试题第三季
- 使用sz rz命令在windows和linux系统之间传文件
- 将u-boot-2016.11移植到TINY4412
- 神经网络和深度学习
- ClustrixDB在centos上的安装
- 你好2017