I wanted to do something. My notifications are set to 11 and 12 hours. I would like to unsubscribe notification of these are set just hours 11. How do I make it?
My code;
NSCalendar *greg = [[NSCalendar alloc]initWithCalendarIdentifier:NSGregorianCalendar];
NSDateComponents * component = [greg components:NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit fromDate:[NSDate date]];
[component setYear:2013];
[component setMonth:m];
[component setDay:d];
[component setHour:x];
[component setMinute:y];
UIDatePicker *dd = [[UIDatePicker alloc]init];
[dd setDate:[greg dateFromComponents:component]];
UILocalNotification * bildirim = [[UILocalNotification alloc]init];
[bildirim setAlertBody:newtask.name];
[bildirim setFireDate:dd.date];
bildirim.soundName = UILocalNotificationDefaultSoundName;
bildirim.alertAction = NSLocalizedString(@"Test", nil);
//[bildirim setFireDate:[NSDate dateWithTimeIntervalSinceNow:0]];
[bildirim setTimeZone:[NSTimeZone defaultTimeZone]];
[[UIApplication sharedApplication] scheduleLocalNotification:bildirim];
I found a code. Unfortunately this code is deleting all notifications.
[[UIApplication sharedApplication] cancelAllLocalNotifications];
Sorry for my bad english.