接收有关卸载iPhone应用程序的事件 [英] Receive event on uninstalling iPhone app

查看:55
本文介绍了接收有关卸载iPhone应用程序的事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户从iPhone卸载我的应用程序时,是否可以在我的应用程序中接收事件/通知?

Is it possible to receive event/notification in my app when user uninstall my application from iPhone?

我需要这个,因为我想在用户卸载我的应用时清理通讯录中的一些数据.

I need this because i want to clean up some data from address book while user uninstall my app.

感谢您的帮助!

推荐答案

不,当他们选择卸载应用程序时,您没有机会执行任何代码.

No, you do not get the opportunity to execute any code when they choose to uninstall your app.

如果您认为他们希望删除的数据添加到通讯簿,则可能应该在应用程序的设置页面上为他们提供一种删除数据的方法.可能会警告用户仅在您打算卸载应用程序时删除此数据"或类似的内容.

If there is data you add to the address book that you think they may wish to remove, then you should probably provide a way for them to do so, perhaps on a settings page inside your app. The user could be warned to "only remove this data if you intend to uninstall the app" or something like that.

更好的是,由于用户以后总是可以在其地址簿中随意更改数据,并且有可能破坏您的应用程序,因此更好的做法是将所有与应用程序相关的数据存储在为您的应用程序自动创建的documents目录,例如plist或sqlite格式.

Better still, since the user could always arbitrarily change data in their address book at a future time, and perhaps break your application, a much better practice would be to store any app-related data in the documents directory created automatically for your app, in a plist or sqlite format for example.

这篇关于接收有关卸载iPhone应用程序的事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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