如何更新 [[UIApplication sharedApplication] ScheduledLocalNotifications] 数组?

发布于 2024-10-12 12:18:07 字数 225 浏览 8 评论 0原文

这可能更多是关于如何更新一般数组的问题,但我有一个正在利用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

青巷忧颜 2024-10-19 12:18:07

获得 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];

笨死的猪 2024-10-19 12:18:07

您无法编辑已存在的通知。

但您可以使用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文