开发者

UiLocalNotifications Based on Id's

开发者 https://www.devze.com 2023-04-05 13:31 出处:网络
Is there any tutorial on storing UIlocalNotificat开发者_StackOverflow中文版ions based on there Id\'s and cancelling the notifications based on there Id\'s in local notification u have userdictionary b

Is there any tutorial on storing UIlocalNotificat开发者_StackOverflow中文版ions 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

use this code

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];
        }
}
0

精彩评论

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

关注公众号