删除某个索引路径处的 UILocalnotification
我有一堆 UILocalNotifications,但我只想删除给定索引路径中的某个通知,因此
[[UIApplication sharedApplication] cancelAllLocalNotifications];
对我来说不起作用。我知道我可以使用
[[UIApplication sharedApplication] cancelLocalNotification:UILocalNotification];
,但是如何从给定的 NSIndexPath 获取 UILocalNotification ?
谢谢。
I have a bunch of UILocalNotifications but I only want to delete a certain one at a given indexpath, therefor
[[UIApplication sharedApplication] cancelAllLocalNotifications];
wont work out for me. I know I can use
[[UIApplication sharedApplication] cancelLocalNotification:UILocalNotification];
but how do I get the UILocalNotification from the given NSIndexPath?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以从以下位置获取一组预定通知:
@property(nonatomic,copy) NSArray *scheduledLocalNotifications
通过您选择的索引号获取您想要的通知,然后将 UILocalNotification* 传递给
- (void)cancelLocalNotification:(UILocalNotification *)通知
。You can get an array of scheduled notification from:
@property(nonatomic,copy) NSArray *scheduledLocalNotifications
Get the one you want by the index number of your choosing and then pass the UILocalNotification* to
- (void)cancelLocalNotification:(UILocalNotification *)notification
.