UIWebView的缓存

tyoutk13520 2010-09-01 04:01:52
我现在要调查UIWebView的缓存(URLCache),时间非常紧。
有没有人做过相关方面的东西,先告诉我一些相关的建议或者一些注意点。
...全文
1983 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
tyoutk13520 2010-09-02
  • 打赏
  • 举报
回复
谢谢你的回答。
这个问题先不理了。
云瑀 2010-09-01
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 tyoutk13520 的回复:]

我可不可以每个UIWebView都指定到独立的缓存文件夹???
[/Quote]
這我就不清楚了
抱歉,無法幫上您
tyoutk13520 2010-09-01
  • 打赏
  • 举报
回复
我可不可以每个UIWebView都指定到独立的缓存文件夹???
云瑀 2010-09-01
  • 打赏
  • 举报
回复
[webView loadRequest: [NSURLRequest requestWithURL: [NSURL URLWithString: url] 
cachePolicy: NSURLRequestUseProtocolCachePolicy
timeoutInterval: 60.0]];


你是说像NSURLRequestUseProtocolCachePolicy ?
NSURLRequestCachePolicy defines constants that are used to specify interaction with the cached responses.


Constant
Description

NSURLRequestUseProtocolCachePolicy
Specifies that the caching logic defined in the protocol implementation, if any, is used for a particular URL load request. This is the default policy for URL load requests.

NSURLRequestReloadIgnoringCacheData
Specifies that the data for the URL load should be loaded from the originating source. No existing cache data should be used to satisfy a URL load request.

NSURLRequestReturnCacheDataElseLoad
Specifies that the existing cached data should be used to satisfy the request, regardless of its age or expiration date. If there is no existing data in the cache corresponding the request, the data is loaded from the originating source.

NSURLRequestReturnCacheDataDontLoad
Specifies that the existing cache data should be used to satisfy a request, regardless of its age or expiration date. If there is no existing data in the cache corresponding to a URL load request, no attempt is made to load the data from the originating source, and the load is considered to have failed. This constant specifies a behavior that is similar to an “offline” mode.

29,031

社区成员

发帖
与我相关
我的任务
社区描述
主要讨论与iOS相关的软件和技术
社区管理员
  • iOS
  • 大熊猫侯佩
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧