对于本地通知您是否在下面尝试过?
NSArray *pendingNotifications = [[[UIApplication sharedApplication] scheduledLocalNotifications] sortedArrayUsingComparator:^(id obj1, id obj2) {
if ([obj1 isKindOfClass:[UILocalNotification class]] && [obj2 isKindOfClass:[UILocalNotification class]])
{
UILocalNotification *notif1 = (UILocalNotification *)obj1;
UILocalNotification *notif2 = (UILocalNotification *)obj2;
return [notif1.fireDate compare:notif2.fireDate];
}
return NSOrderedSame;
}];
// if there are any pending notifications -> adjust their badge number
if (pendingNotifications.count != 0)
{
//do something
}
你不能使用NSNotification的userInfo吗? – 2014-09-22 09:50:03