Note that there are some explanatory texts on larger screens.

plurals
  1. POCancel UILocalNotification
    text
    copied!<p>I have a problem with my UILocalNotification. </p> <p>I am scheduling the notification with my method. </p> <pre><code>- (void) sendNewNoteLocalReminder:(NSDate *)date alrt:(NSString *)title { // some code ... UILocalNotification *localNotif = [[UILocalNotification alloc] init]; if (localNotif == nil) return; localNotif.fireDate = itemDate; localNotif.timeZone = [NSTimeZone defaultTimeZone]; localNotif.alertAction = NSLocalizedString(@"View Details", nil); localNotif.alertBody = title; localNotif.soundName = UILocalNotificationDefaultSoundName; localNotif.applicationIconBadgeNumber = 0; NSDictionary *infoDict = [NSDictionary dictionaryWithObject:stringID forKey:@"id"]; localNotif.userInfo = infoDict; [[UIApplication sharedApplication] scheduleLocalNotification:localNotif]; [localNotif release]; } </code></pre> <p>Its work fine and I'm correctly receiving the notification. The problem is when I should cancel the notification. Im using this method. </p> <pre><code>- (void) deleteNewNoteLocalReminder:(NSString*) reminderID noteIDe:(NSInteger)noteIDE { [[UIApplication sharedApplication] cancelLocalNotification:(UILocalNotification *)notification ???? } </code></pre> <p>Im not sure what to do here, but my questions are: </p> <p>How do I know which UILocalNotification object I should delete?<br> Is there a way to list all notifications? </p> <p>The only thing I have is the ID of which reminder I should delete.<br> I was thinking about to save the UILocalNotification object in my "Note" object and get it that way, and when I saving to my SQLite database serialize the object and so on ... is there a smarter way? </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload