gpt4 book ai didi

ios - 完成后如何执行方法 UILocalNotification cancelLocalNotification : in iOS 8 or 9

转载 作者:行者123 更新时间:2023-11-28 21:15:52 24 4
gpt4 key购买 nike

我需要在通过 cancelLocalNotification: 删除相同的 UILocalNotification 后显示它。问题是移除执行速度比触发新通知慢,并且移除刚刚添加的通知。

如何确定 UILocalNotification cancelLocalNotification: 已完成?

最佳答案

调用 UILocalNotification cancelLocalNotification 后可以稍等片刻:并重新注册新的 UILocalNotification

像这样

[[UIApplication sharedApplication] cancelLocalNotification:someNotification];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
/* register UILocalNotification again here after delay */

});

关于ios - 完成后如何执行方法 UILocalNotification cancelLocalNotification : in iOS 8 or 9,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41331814/

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