я использовал эту ссылку , чтобы установить Repeat UILocalNotification, и мой код запускается успешно, но проблема в том, что даже когда я удаляю свое приложение, всплывающие оповещения есть, есть ли способ отменить повторное UILocalNotification прагматично
это код, который я использую для установки повторного UILocalNotification через 1 минуту
- (void)alertSelector:(NSString *)AlertTitle WithFiringTime:(NSDate *)date{
UILocalNotification *localNotification = [[[UILocalNotification alloc] init] autorelease];
if (!localNotification)
return;
[localNotification setFireDate:date];
[localNotification setTimeZone:[NSTimeZone defaultTimeZone]];
NSDictionary *data = [NSDictionary dictionaryWithObject:date forKey:@"payload"];
[localNotification setUserInfo:data];
[localNotification setAlertBody:AlertTitle];
[localNotification setAlertAction:@"View"];
[localNotification setHasAction:YES];
localNotification.repeatInterval = NSMinuteCalendarUnit;
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
}
с кодом ниже, я отменяю UILocalNotification, но он отменяет все UILocalNotification, и я хочу отменить толькоUILocalNotification, которое появляется через 1 минуту, повторите UILocalNotification
[[UIApplication sharedApplication] cancelAllLocalNotifications];
Заранее благодарен