【发布时间】:2011-10-07 13:32:55
【问题描述】:
其实是在开发一个报警项目, 现在我对本地通知有疑问。我如何识别特定通知。 我们甚至不能将标签设置为本地通知,那么我该如何区分它们。
示例:
通知:1
UILocalNotification *localNotification = [[UILocalNotification alloc] init];
localNotification.fireDate = selectedDate;
localNotification.alertBody = @"you got work";
localNotification.alertAction = @"Snooze";
localNotification.repeatInterval = NSDayCalendarUnit;
localNotification.soundName = UILocalNotificationDefaultSoundName;
NSDictionary *infoDict = [NSDictionary dictionaryWithObjectsAndKeys:@"setNotificationForEveryDay", @"key", nil];
localNotification.userInfo = infoDict;
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
[localNotification release];
通知:2,
UILocalNotification *localNotification = [[UILocalNotification alloc] init];
localNotification.fireDate = another selectedDate;
localNotification.alertBody = @"i got work";
localNotification.alertAction = @"Snooze";
localNotification.repeatInterval = NSDayCalendarUnit;
localNotification.soundName = UILocalNotificationDefaultSoundName;
NSDictionary *infoDict = [NSDictionary dictionaryWithObjectsAndKeys:@"setNotificationForEveryDay", @"key", nil];
localNotification.userInfo = infoDict;
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
[localNotification release];
现在我要删除第二个通知我该怎么做... 请帮我.. 提前谢谢..
【问题讨论】: