存档/取消存档 UIWebView? [英] Archive/Unarchive UIWebView?

查看:27
本文介绍了存档/取消存档 UIWebView?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 iPhone SDK 中将 UIWebView 的当前状态保存到磁盘.

I would like to save the current state of an UIWebView to disk in IPhone SDK.

我有一个 UIWebView,它加载了一个包含大量 javascript 的网站.我想保存 UIWebView 的状态,保持当时 javascript 变量、http cookie 等的状态.

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.

稍后,我想取消归档 UIWebview 并将其显示在屏幕上,其状态与归档时完全相同.

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.

这可能吗?

推荐答案

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

这篇关于存档/取消存档 UIWebView?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆