有没有一种简单的方法来编辑/修改 UILocalNotification [英] Is there a simple way to edit / modify a UILocalNotification

查看:33
本文介绍了有没有一种简单的方法来编辑/修改 UILocalNotification的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有更简单的方法来编辑,例如,已经安排好的 UILocalNotification 的 alertBody 属性?

Is there an easier way to edit, for example, the alertBody property of an already scheduled UILocalNotification ?

目前,我只是取消通知并安排新的通知,但是当应用程序需要为 3 个或更多通知执行此操作时,执行需要很长时间...

For now, I just cancel the notification and schedule a new one but when the app needs to do this for 3 or more notifications, it takes long time to execute...

推荐答案

如果文档正确,您将无法更改已安排好的通知.-scheduleLocalNotification::

If the documentation is correct, you can't alter an already scheduled notification. The doc states for -scheduleLocalNotification::

[…] 因为操作系统复制通知,您可以发布一次你已经安排好了.

[…] Because the operating system copies notification, you may release it once you have scheduled it.

通知对象由系统复制,不能通过任何(公共)方法访问.因此,除了取消通知之外,没有其他解决方案.

The notification object is copied by the system and not accessible via any (public) method. So there's no other solution than canceling the notification.

这篇关于有没有一种简单的方法来编辑/修改 UILocalNotification的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆