iPhone localstorage lifecycle - does it survive an app-update?

六月ゝ 毕业季﹏ 提交于 2019-12-09 16:50:03

问题


I'm currently developing an iPhone App that uses Phonegap and HTML5. I use localstorage to save in-game-achievements.

I was wondering what would happen the user pulls an update for that app from the AppStore. Is the localstorage data persistent? Or do I have to switch to SQLite, which is actually abandoned by the W3C..

Any experience would be appreciated.


回答1:


Yes your localStorage is going to stick around until the app is deleted.

Try it out by building a basic app that you set some localStorage items, then recompile and update the app with changes your localStorage will stay where it is.

SQLLite will work, but you can store quite a bit of information in localStorage and achieve nearly the same results.

I use localStorage in a number of projects and it works great!

Hope that answers your question




回答2:


If for localstorage you mean NSLibraryDirectory or NSDocumentDirectory your data should be available even after an upgrade.



来源:https://stackoverflow.com/questions/9022339/iphone-localstorage-lifecycle-does-it-survive-an-app-update

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!