简体   繁体   English

如何在iOS 4及更高版本中缓存整个网页

[英]How to cache whole webpage in ios 4 and above

I am new to iphone development. 我是iPhone开发的新手。 I would like to know how to do the caching in ios 4 and above?? 我想知道如何在iOS 4及更高版本中进行缓存? I got many answers but right now I get confused and don't know from where to start. 我得到了很多答案,但是现在我很困惑,不知道从哪里开始。

In my project, I am doing http request and displaying results using UIWebView 在我的项目中,我正在执行http请求并使用UIWebView显示结果

Here,I want to cache the http data. 在这里,我想缓存http数据。 So next time when application starts again then It will reload the data from the cache. 因此,下次应用程序再次启动时,它将从缓存中重新加载数据。

how to cache the webpage data in IOs 4 and above? 如何在IO 4及更高版本中缓存网页数据?

I have done with caching of whole web page using ASIHTTPRequest. 我已经使用ASIHTTPRequest缓存了整个网页。 I go through the ASIHTTPRequest: here is a link to it. 我通过ASIHTTPRequest:这是它的链接。

You will have to make use of Core Data to store your data locally by modeling your data in it. 您将必须使用Core Data通过在其中建模数据来在本地存储数据。 You will need to go through the core data programming guide: here is a link to it. 您将需要阅读核心数据编程指南:这是它的链接。 http://developer.apple.com/library/mac/documentation/cocoa/Conceptual/CoreData/CoreData.pdf http://developer.apple.com/library/mac/documentation/cocoa/Conceptual/CoreData/CoreData.pdf

After you have understood for how to store your data, you will able to easily able to load this when your app starts the next time. 了解了如何存储数据后,您将可以在下次启动应用程序时轻松加载该数据。 Im not sure of how to store the web view's data as an html page locally, though that can be an alternative approach too. 我不确定如何在本地将Web视图的数据存储为html页面,尽管这也可以作为替代方法。 I hope it helps you!!! 希望对您有帮助!!! Cheers!! 干杯!!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM