是否有基于Id的存储UIlocalNotifications的教程,并根据Id的
取消通知答案 0 :(得分:3)
在本地通知中你有这个词典的userdictionary你取消你的通知。
使用此代码
在时间设置本地通知中设置用户信息中的ID。
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];
}
}