Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/113.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iOS>>UILocalNotification丢失_Ios_Objective C_Uilocalnotification_Appdelegate - Fatal编程技术网

iOS>>UILocalNotification丢失

iOS>>UILocalNotification丢失,ios,objective-c,uilocalnotification,appdelegate,Ios,Objective C,Uilocalnotification,Appdelegate,在我的应用程序中,可能会出现这样一种情况:几个本地通知将以非常接近的“发布日期”被非常接近地发布 如果应用程序位于前台,则AppDelegate似乎通过didReceiveLocalNotification方法捕捉到了所有这些内容 但是。。。如果应用程序处于后台或已关闭,我单击主屏幕中弹出的“弹出窗口”,此方法仅捕获第一个通知,而其他通知似乎丢失;我需要他们所有人 有人吗?有关本地通知,您在下面尝试过吗 NSArray *pendingNotifications = [[[UIApplicati

在我的应用程序中,可能会出现这样一种情况:几个本地通知将以非常接近的“发布日期”被非常接近地发布

如果应用程序位于前台,则AppDelegate似乎通过didReceiveLocalNotification方法捕捉到了所有这些内容

但是。。。如果应用程序处于后台或已关闭,我单击主屏幕中弹出的“弹出窗口”,此方法仅捕获第一个通知,而其他通知似乎丢失;我需要他们所有人


有人吗?

有关本地通知,您在下面尝试过吗

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的用户信息吗?