扫码关注官方订阅号
如何在Appdelegate.m的 active的代理方法中modal出一个UIAlertController?
报错信息大家可以忽略,主要问题就在最后一块儿
拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...
//初始化UIAlertController
UIAlertController *alertCtl = [UIAlertController alertControllerWithTitle:@"提示" message:@"AppDelegate中" preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction *alertAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:nil]; [alertCtl addAction:alertAction]; //初始化UIWindows UIWindow *aW = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds]; aW.rootViewController = [[UIViewController alloc]init]; aW.windowLevel = UIWindowLevelAlert + 1; [aW makeKeyAndVisible]; [aW.rootViewController presentViewController:alertCtl animated:YES completion:nil];
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
扫描下载App
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
//初始化UIAlertController