如何更新 [[UIApplication sharedApplication] ScheduledLocalNotifications] 数组?
这可能更多是关于如何更新一般数组的问题,但我有一个正在利用 UILocalNotifications 的应用程序,我想允许用户选择他们设置的通知并编辑它们。
那么我该怎么做才能更新索引处的对象呢?
[[[UIApplication sharedApplication] scheduledLocalNotifications] ??];
感谢您的帮助!
This may be more of a question regarding how to update arrays in general, but I have an app that is utilizing UILocalNotifications, and I want to allow users to select the notifications they have set, and edit them.
So what could I do to update an object at an index?
[[[UIApplication sharedApplication] scheduledLocalNotifications] ??];
Thanks for any help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
获得
UILocalNotification
对象后,您可以通过使用以下命令取消旧通知来“重新安排”它:[[UIApplication shareApplication] cancelLocalNotification:aNotification];
并安排一个新通知:
[[UIApplication共享应用程序]scheduleLocalNotification:aNotification];
Once you get the
UILocalNotification
object, you can "reschedule" it by canceling the old notification with:[[UIApplication sharedApplication] cancelLocalNotification:aNotification];
and scheduling a new one:
[[UIApplication sharedApplication] scheduleLocalNotification:aNotification];
您无法编辑已存在的通知。
但您可以使用
cancelLocalNotification
: 取消它并创建一个新的通知。You can not able to edit an already existing notification.
But you can able to cancel it by using
cancelLocalNotification
: and create a fresh notification.