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

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

问题描述

我想将UIWebView的当前状态保存到IPhone SDK中的磁盘。

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天全站免登陆