有没有办法在iOS中的应用程序安装和卸载之间保留应用程序数据 [英] Is there a way to persist application data between application installs and uninstalls in iOS

查看:109
本文介绍了有没有办法在iOS中的应用程序安装和卸载之间保留应用程序数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个需要在启动时执行昂贵计算的应用程序。因此,应用程序第一次运行时,应用程序会执行计算并将结果存储在文件中。

I am developing an application that needs to perform expensive calculations at start up. So, the first time the application runs, the application do the calculations and store the result in a file.

如果用户决定卸载应用程序并重新安装之后,计算必须再次进行,我想避免重新计算。请注意,我不是在谈论应用程序的更新,而是关于卸载/重新安装。

If the user decides to uninstall the application and to re-install it later, the calculations have to be done again and I would like to avoid to re-calculate. Notice that I am not talking about updates of the application but about uninstall / re-install.

我想知道是否有一种方法可以仅为我的应用程序保留数据但这可以在卸载后继续使用。

I was wondering if there is a way to persist data accessible only for my application but that can survive uninstalls.

解决方案可以在设备内部(使用文件/首选项/ ...)或基于服务器。例如,一个可能的解决方案是将带有结果的设备ID发送到服务器并将其存储在那里,但由于iOS 5中已弃用设备ID,因此不再是有效的解决方案。

The solution can be inside the device (using kind of files / preferences / ...) or based in a server. For example, a possible solution could be to send the device id with the result to a server and to store it there, but as the device id has been deprecated in iOS 5, is not a valid solution anymore.

感谢您的回答。

Jaime

推荐答案

您没有说明有多少数据,但以下是选项:

You don't say how much data, but the following would be options:


  • iCloud

  • 钥匙扣

  • Dropbox

唯一的通用选项,即虽然你受到可以使用的空间量的限制,所以所有设备都将拥有并且无法禁用,是钥匙串。

The only "universal" option, that all devices will have and that cannot be disabled, is the Keychain though you are limited by the amount of space you can use.

就我个人而言,我什么都不做。如果用户删除了应用程序,我认为在重新安装时必须重新计算内容是公平的游戏。

Personally, I would do nothing. If the user deletes the app I think it's fair game to have to recompute stuff on reinstallation.

这篇关于有没有办法在iOS中的应用程序安装和卸载之间保留应用程序数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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