本文介绍了删除某个索引路径的 UILocalnotification的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一堆 UILocalNotifications 但我只想删除给定索引路径中的某个,因此
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];
但是如何从给定的 NSIndexPath 获取 UILocalNotification?
but how do I get the UILocalNotification from the given NSIndexPath?
谢谢.
推荐答案
你可以从:@property(nonatomic,copy) NSArray *scheduledLocalNotifications
通过您选择的索引号获取您想要的一个,然后将 UILocalNotification* 传递给 - (void)cancelLocalNotification:(UILocalNotification *)notification
.
Get the one you want by the index number of your choosing and then pass the UILocalNotification* to - (void)cancelLocalNotification:(UILocalNotification *)notification
.
这篇关于删除某个索引路径的 UILocalnotification的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!