开发者

Delete a UILocalnotification at a certain indexpath

开发者 https://www.devze.com 2023-02-22 05:20 出处:网络
I have a bunch of UILocalNotifications but I only wa开发者_JAVA百科nt to delete a certain one at a given indexpath, therefor

I have a bunch of UILocalNotifications but I only wa开发者_JAVA百科nt 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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消