iOS/objective-C : Is there any way to see what localNotifications are scheduled?

标签 ios objective-c uilocalnotification

<分区>

我正在尝试让本地通知根据时间工作。我已经创建了一个 localNotification 实例,但在创建本地通知时同时尝试正确获取时间和日期。

出于调试目的,有没有办法查看安排了哪些本地通知?

我已经尝试了以下但没有看到任何触发:

 [[UIApplication sharedApplication] scheduleLocalNotification:reminderNotification];
 scheduled++;
 [[UIApplication sharedApplication] presentLocalNotificationNow:reminderNotification];
 scheduled++;

感谢您的任何建议。

最佳答案

是的,你可以:

[[UIApplication sharedApplication] scheduledLocalNotifications]

将返回现有通知实例的数组。

关于iOS/objective-C : Is there any way to see what localNotifications are scheduled?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32554649/

上一篇:ios - Async_Dispatch 线程

下一篇:ios - 为什么 NSUserDefaults 总是返回 nil?

相关文章:

android - Adobe PhoneGap 是否使用 config.xml?

ios - 调整消息传递应用程序的 View

ios - UILocalNotification 应用程序在后台

ios - UILocalNotification 用户信息中的 Swift 字典

iphone - 我不知道为什么这个 TableView 代码崩溃

ios - watch 套件 : handleWatchKitExtensionRequest multiple instances

iphone - ABAddressBookRef 在 iOS 6 上获取 0 个联系人

ios - NSPredicate 没有返回预期的项目

iphone - 预定的 UILocalNotifications 是 iOS 设备备份的一部分吗?

ios - 适合初学者的 Swift 核心图