Overview
- I am creating a notification based on an existing instance of
UILocalNotification - Existing instance has
repeatIntervalset toNSWeekdayCalendarUnit
What I want to do
- I want to set
repeatIntervalto no repeat,
Question
- What is the constant that I should set
repeatIntervalto in order for it not to repeat ?
Taken from Apple documentation:
I assume you want to cancel the notification with the repeating interval, you can do that in two ways:
The first option is easy, use:
In your app delegate.
The second one requires more work. You need to go through the pending notifications (use
scheduledLocalNotifications) and cancel the notification.In order to know which notifications is going to be canceled you can use the
userInfoproperty when you set the notification. For example set an unique ID for every notification so when you cancel that notification you simply compare that ID with all the IDs in yourscheduledLocalNotificationsarray.