我在iOS应用程序上使用PushNotification.我想在应用收到通知时显示UIalertcontroller.
我在AppDelegate中尝试以下代码:
[self.window.rootViewController presentViewController:alert animated:YES completion:nil];
Run Code Online (Sandbox Code Playgroud)
但是UIAlertcontroller正在根视图(第一个屏幕)中显示,而对于其他uiviewcontroller,我收到警告或应用程序崩溃.