存档/取消存档 UIWebView?
我想将 UIWebView 的当前状态保存到 iPhone SDK 中的磁盘。
我有一个 UIWebView,它加载一个包含大量 JavaScript 的网站。我想保存 UIWebView 状态,维护当时 javascript 变量、http cookie 等的状态。
然后稍后,我想取消存档 UIWebview 并将其显示在屏幕上,其状态与存档时完全相同。
这可能吗?
I would like to save the current state of an UIWebView to disk in IPhone SDK.
I have a UIWebView that loads a website with lots of javascript. I would like to save the UIWebView state, maintaining the state of the javascript variables, http cookies, etc. at that moment.
Then at a later time, I would like to unarchive the UIWebview and display it on the screen with the exact same state as it was when it was archived.
Is this possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我尝试在之前的项目中执行此操作,但没有内置的 UIWebView 序列化。 有几种方法可以仅缓存页面而不缓存整个状态,例如 JavaScript 变量。 这将要求 JVM 的状态也被序列化,而这对于当前的 SDK API 来说是不可能的。
I tried to do this on a previous project and there's no built-in serialization of UIWebView. There's a couple of ways to cache just the page but not the entire state such as javascript variables. This would require that the JVM's state be serialized as well which is not possible with the current SDK APIs.