1

我有一堆 UILocalNotifications 但我只想删除给定索引路径中的某个,因此

[[UIApplication sharedApplication] cancelAllLocalNotifications];

不会为我工作。我知道我可以使用

[[UIApplication sharedApplication] cancelLocalNotification:UILocalNotification];

但是如何从给定的 NSIndexPath 获取 UILocalNotification?

谢谢。

4

1 回答 1

2

您可以从以下位置获取一系列预定通知:@property(nonatomic,copy) NSArray *scheduledLocalNotifications

通过您选择的索引号获取您想要的,然后将 UILocalNotification* 传递给- (void)cancelLocalNotification:(UILocalNotification *)notification.

于 2011-04-05T02:38:14.040 回答