How can I update the [[UIApplication sharedApplication] scheduledLocalNotifications] array?
-
12-10-2019 - |
Question
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!
Solution
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];
OTHER TIPS
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.