は、私は私が元第三swichのためpreticular 1 nofticationをキャンセルする必要がありませんが、第三通知すべてのローカル通知をキャンセルしないようにする方法。単一の通知をキャンセルしたり
をキャンセル-(IBAction)switchingbtn:(id)sender
{
UISwitch *onoff = (UISwitch *) sender;
UILocalNotification *localNotif = [[UILocalNotification alloc] init];
if(onoff.on)
{
NSLog(@"Shedule notification");
int tagValue=[sender tag];
NSMutableDictionary *dict = (NSMutableDictionary *)[alarmsArray objectAtIndex:tagValue];
NSDate *firedate = [dict objectForKey:@"date"];
NSLog(@"fire date is %@", firedate);
localNotif.fireDate = firedate;
localNotif.alertBody = @"Start Exercise";
localNotif.applicationIconBadgeNumber = 0;
// localNotif.timeZone =[NSTimeZone timeZoneForSecondsFromGMT:0];
localNotif.timeZone = [NSTimeZone systemTimeZone];
localNotif.repeatInterval = kCFCalendarUnitDay;
// [[UIApplication sharedApplication] scheduleLocalNotification:localNotif]; //**Not working**
[localNotif release];
}
に対応するスイッチを使用して、各セルのためのリマインダーを設定しなかった次のようにテーブルビューを持っている作品
else
{
// Cancel a notification not works
// [[UIApplication sharedApplication] cancelLocalNotification:localNotif];
[[UIApplication sharedApplication] cancelAllLocalNotifications];
NSLog(@"cancel notification");
}