存档/取消存档 UIWebView?

发布于 2024-08-02 04:16:16 字数 216 浏览 5 评论 0原文

我想将 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

农村范ル 2024-08-09 04:16:16

我尝试在之前的项目中执行此操作,但没有内置的 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文