0

Possible Duplicate:
Is there a simple way to edit / modify a UILocalNotification

I have an app in which I am firing local notifications at particular time intervals by selecting time from date picker. I have an edit page where I can change the time of the date picker. This is working fine.

But the problem is I don't know how to edit a scheduled notification. I want that the time that i have selected through the edit page and saved should get saved in the notification.

halfer
  • 19,824
  • 17
  • 99
  • 186
Rani
  • 3,333
  • 13
  • 48
  • 89

2 Answers2

0

You can cancel the already scheduled Notification and schedule a new one by computing the time left until the cancelled notification was going to be fired.

To cancel a local notification use cancelLocalNotification: of the UIApplication instance you can get using [UIApplication sharedApplication]

HyLian
  • 4,999
  • 5
  • 33
  • 40
0

I think ... you could modify the scheduled notification (Instance of UILocalNotification) ...

Here is from the Apple documentation ..

Once you have created an instance of UILocalNotification, you schedule it using one of two methods of the UIApplication class: scheduleLocalNotification: or presentLocalNotificationNow:. The former method use the fire date to schedule delivery; the latter method presents the notification immediately, regardless of the value of fireDate. You can cancel specific or all local notifications by calling cancelLocalNotification: or cancelAllLocalNotifications, respectively.

So you can cancel the notification and then schedule it again using scheduleLocalNotification

Here is from the Apple documentation ..

Note: Prior to iOS 4.2, this property was a read-only method. A setter method has been added and the method has been converted to a read-write property. When you set this property, UILocalNotification replaces all existing notifications by calling cancelLocalNotification: and then calling scheduleLocalNotification: for each new notification.

Jhaliya - Praveen Sharma
  • 31,697
  • 9
  • 72
  • 76
  • but i want that when i select time from datepicker which is in different class and click on the save button that time must get saved on my previously scheduled notification – Rani Nov 24 '11 at 10:40