ios – 在iPad Safari上的localStorage是否保持持续?

我已经看到网络上的意见分歧.据说,从iOS 5.1开始,iPad上的 HTML5内容的本地数据存储不再保证是持久的,但是在苹果当前的Safari开发者页面( https://developer.apple.com/technologies/safari/html5.html)上,建议离线持久性被保证.

有没有人有任何最近的经验与这个问题,并能评论如何可靠的数据库HTML5的功能与Safari在iPad上?

解决方法

这可能足够的信息:
localStorage的w3c规范是:

The second storage mechanism (note: localStorage) is designed for storage that spans multiple windows,and lasts beyond the current session. In particular,Web applications may wish to store megabytes of user data,such as entire user-authored documents or a user’s mailBox,on the client side for performance reasons.

在Apple页面上:

Safari supports the latest HTML5 offline data storage features. Your application can store its information on the local machine using either a simple key/value-based data store,or a robust sql database. The data is stored locally and persists across launches of Safari so your application doesn’t need a network connection to access the data,improving startup time and overall performance.

搜索谷歌(和雅虎,因为一些反谷歌的怪胎)给了我:

In iOS 5.1 Apple have moved the location of localStorage files into a Caches folder which is subject to occasional clean up,at the behest of the OS,typically if space is short. It is likely that Apple have done this to stop localStorage being backed up to iCloud.

localStorage not accessible in IOS-6 Safari

I am not able to access localStorage in Safari (IPad with IOS-6).
For example,the following code is working fine in Windows on all browsers and on (iPad with iOS-5) but not in iOS-6:
localStorage.setItem(“var”,”5″);
alert(localStorage.getItem(“var”));

回答:

I was able to fix the issue by turning off private browsing on the iPad. I came across the solution from the reference : 07001

相关文章

UITabBarController 是 iOS 中用于管理和显示选项卡界面的一...
UITableView的重用机制避免了频繁创建和销毁单元格的开销,使...
Objective-C中,类的实例变量(instance variables)和属性(...
从内存管理的角度来看,block可以作为方法的传入参数是因为b...
WKWebView 是 iOS 开发中用于显示网页内容的组件,它是在 iO...
OC中常用的多线程编程技术: 1. NSThread NSThread是Objecti...