由于从推送通知启动时没有系统应用程序而终止

Terminating since there is no system app when launching from push notification

我有一个应用程序,当任何人回答问题时都会收到通知。因此,当我收到通知并点击它时,我必须转到 answerviewcontroller。 我为此使用以下代码。但是应用程序崩溃显示 "Terminating since there is no system app."。 phone 以苹果标志重新启动。为什么???请帮忙

    -(void)pushdetailsViewController
{
    dispatch_async(dispatch_get_main_queue(), ^{
        UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle: nil];
         QPYourQuestionController *controller = (QPYourQuestionController*)[mainStoryboard instantiateViewControllerWithIdentifier: @"yourQuestion"];
      [[QPCommonClass initializeUserDefaults]setObject:[pushDictonary valueForKey:@"question_id"] forKey:@"currentquestionID"];
        NSLog(@"Dictionary %@",pushDictonary);

        UINavigationController *navigationController = (UINavigationController *)self.window.rootViewController;
        [navigationController pushViewController:controller animated:YES];


    });
}

这不会回答您的问题,但可能会帮助遇到同样问题的人。这是您可以展示的 Apple 错误 here,没有人能找出确切的解决方案。

解决方案一: 您混淆了 SpringBoardstoryboards。您的 storyboard 没问题,但您需要重新启动设备(或退出并重新启动模拟器),因为 SpringBoard(处理主屏幕的进程)已终止。

解决方案 2:请删除 dispatch_async(dispatch_get_main_queue() 语句并卸载应用程序并清理并构建

解决方案 3: 该错误消息只是告诉您 iOS 停止了 运行ning。所以很明显,该应用程序不再 运行ning 并且在 iPad 完成重新启动之前将无法再次使用。至于导致崩溃的原因,您需要做更多的探索。一定要打开异常断点,看能不能赶在整个设备之前崩溃crashes。另一件要记住的事情是,无论出于何种原因,如果您安装了分发配置文件,调试器将无法工作。例如,如果您的应用程序包含推送配置文件,它总是会在启动后不久崩溃,因为调试器会随之关闭它。

解决方案 4: 对我有用的是删除 iPhone 模拟器中的应用程序,强制退出模拟器并再次点击 运行 Xcode.