简体   繁体   English

有没有办法知道在iOS中删除应用程序的时间?

[英]Is there a way to know when an app is deleted in iOS?

my problem is this: 我的问题是这样的:

I have scheduled some UILocalNotifications on an iOS app, the problem is that if I delete the app without deleting the objects associated with the notifications (and consequently removing the notifications from the scheduledNotifications array) the notifications still fire. 我已经在iOS应用程序上安排了一些UILocalNotifications,问题是如果我删除应用程序而不删除与通知关联的对象(并因此从scheduledNotifications数组中删除通知),通知仍然会触发。

Although I have not experienced them actually firing (they are set to repeat within a week's interval) I have evidence of this since I NSLog the scheduledNotifications array at application launch, which even after deleting the app and reinstalling it (with the entities of the data model gone), still shows some scheduled notifications. 虽然我没有经历过它们实际触发(它们被设置为在一周的间隔内重复)但我有证据证明这是因为我在应用程序启动时NSLog the scheduledNotifications数组,即使在删除应用程序并重新安装它之后(使用数据的实体)模型消失了),仍然显示一些预定的通知。

I've searched the UIApplication and the UIApplicationDelegate reference in Apple's reference library but I found no method to know if the app is being deleted, if there is I would just write 我在Apple的参考库中搜索了UIApplication和UIApplicationDelegate参考,但我发现没有方法可以知道应用程序是否被删除,如果有的话我会写的

[[UIApplication sharedApplication] cancelAllLocalNotifications];

in said method. 在所述方法中。

So, is there a way for knowing this? 那么,有没有办法知道这一点?

Thank you in advance, your help is very much appreciated. 提前感谢您,非常感谢您的帮助。

这是4.0中的错误,即使用户删除了应用程序,也会重复本地通知,但至少该错误是Apple在以后的版本中修复的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM