iPhone What happens to previous data when app is upgraded to new version

放肆的年华 提交于 2019-11-30 14:20:57

问题


I have a query regarding What happens to previous data when app is upgraded to new version .

I have a current application having a local database. The user can modify the database.

Now If I upgrade the application to next version with some new functionality what will happen? Will it completely replace the database or I can still use it. And if the database is still there then how can new functionality use it as earlier i.e. Assuming that it is still in the resources?

Please help in this regard. Thanks in advance.

EDIT:

I tried and found that We can use the earlier database.

One more question.

How to notify the user that an upgrade is available for the app? Do I need to use push notification or is there any other method?


回答1:


The data in ~/Documents and ~/Library/Preferences will be kept. Those in ~/Library – I'm not sure, but I think they will be kept too. Those in your .app folder will be completely replaced, but the user can't change what's in your .app folder anyway.




回答2:


App data is managed by Bundle identifier, as app update is also on same Bundle identifier,

When user updates app, it automatically connected with same Bundle identifier, so data will be same as old version

But if u delete(uninstall) app then it will remove all relevant data from iPhone, then installing new upgraded app will not get old data



来源:https://stackoverflow.com/questions/2099747/iphone-what-happens-to-previous-data-when-app-is-upgraded-to-new-version

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