相关疑难解决方法(0)

如何从Appdelegate展示UIAlertController

我在iOS应用程序上使用PushNotification.我想在应用收到通知时显示UIalertcontroller.

我在AppDelegate中尝试以下代码:

[self.window.rootViewController presentViewController:alert animated:YES completion:nil];
Run Code Online (Sandbox Code Playgroud)

但是UIAlertcontroller正在根视图(第一个屏幕)中显示,而对于其他uiviewcontroller,我收到警告或应用程序崩溃.

iphone objective-c ios uialertcontroller swift3

30
推荐指数
4
解决办法
2万
查看次数

标签 统计

ios ×1

iphone ×1

objective-c ×1

swift3 ×1

uialertcontroller ×1