objective-c - How to modal a UIAlertController in the active method of Appdelegate.m
高洛峰
高洛峰 2017-05-02 09:24:06
0
1
591

How to modal a UIAlertController in the active proxy method of Appdelegate.m?

You can ignore the error message, the main problem lies in the last part

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(1)
刘奇

//Initialize 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];
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template