基于ID的UiLocalNotifications [英] UiLocalNotifications Based on Id's

查看:88
本文介绍了基于ID的UiLocalNotifications的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否存在有关基于那里的ID存储UIlocalNotifications以及基于那里的ID取消通知的教程

Is there any tutorial on storing UIlocalNotifications based on there Id's and cancelling the notifications based on there Id's

推荐答案

在本地通知中您有此字典的用户词典,您取消了您的通知.

in local notification u have userdictionary by this dictionary u cancele your notification.

  • http://www.picksourcecode.com/ps/ct/161237.php
  • http://iphonesdkdev.blogspot.com/2010/04/local-push-notification-sample-code-os.html
  • http://useyourloaf.com/blog/2010/7/31/adding-local-notifications-with-ios-4.html

使用此代码

在设置本地通知的时间中,在用户信息中设置ID.

in the time set local notification u set the id in user info.

NSMutableArray *SheduleArray=[[NSMutableArray alloc] initWithArray:[[UIApplication sharedApplication]scheduledLocalNotifications]];
for(int s=0;s<[SheduleArray count];s++){
    UILocalNotification *Not=[SheduleArray objectAtIndex:s];
    int getId=[[Not.userInfo valueForKey:@"Id"] intValue];
    if(getId==yourId)
        {
            [[UIApplication sharedApplication] cancelLocalNotification:Not];
        }
}

这篇关于基于ID的UiLocalNotifications的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆