【发布时间】:2016-02-15 15:34:09
【问题描述】:
我正在使用以下代码在我的应用程序中安排UILocalNotification。问题是通知动画两次。
UILocalNotification *localNotification = [UILocalNotification new];
localNotification.alertBody = @"Test message";
localNotification.fireDate = [NSDate dateWithTimeIntervalSinceNow:3];
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
该代码在按钮操作中执行。然后我将应用程序发送到后台并等待通知被触发。
发生的情况是我只有一个通知,但动画(向下滑动动画)执行了两次。
首先我开始认为这是一个 iOS 错误,但后来我创建了一个非常简单的项目,其中只有触发通知的代码并且问题没有发生。
当应用程序进入此状态时,问题总是会发生。如果我重新启动设备,那么一切都会按预期开始工作。我没有找到使应用处于这种状态的模式。
这只发生在 iOS 9 设备上。
【问题讨论】:
-
我建议您找到重现此状态的模式,然后添加相应的代码。仅此代码我们无法为您提供帮助。
-
感谢@TroyT。 fcardoso 的回复确实有帮助,我解决了我的问题。
标签: ios animation ios9 uilocalnotification