gpt4 book ai didi

ios - UILocalNotification 动画两次

转载 作者:可可西里 更新时间:2023-11-01 03:53:32 26 4
gpt4 key购买 nike

<分区>

我正在使用以下代码在我的应用程序中安排 UILocalNotification。问题是通知动画两次。

UILocalNotification *localNotification = [UILocalNotification new];
localNotification.alertBody = @"Test message";
localNotification.fireDate = [NSDate dateWithTimeIntervalSinceNow:3];
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];

该代码在按钮操作中执行。然后我将应用程序发送到后台并等待触发通知。

发生的情况是我只有一个通知,但动画(向下滑动动画)执行了两次。

起初我开始认为这是一个 iOS 错误,但后来我创建了一个非常简单的项目,其中只有触发通知的代码并且问题没有发生。

当应用程序进入此状态时,问题总是会发生。如果我重新启动设备,那么一切都会按预期开始工作。我没能找到使应用程序处于这种状态的模式。

这只发生在 iOS 9 设备上。

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com