Trying to dismiss the presentation controller while transitioning already
来源:互联网 发布:turtlebot编程 编辑:程序博客网 时间:2024/05/18 01:18
iOS8开始使用UIAlertController
今天遇到一个问题,效果是展示一个alert 之后消失
在iOS8中崩溃
崩溃信息:
Trying to dismiss the presentation controller while transitioning already. (<_UIAlertControllerAlertPresentationController: 0x78feff20>)transitionViewForCurrentTransition is not set, presentation controller was dismissed during the presentation? (<_UIAlertControllerAlertPresentationController: 0x78feff20>)
这是写的代码
UIAlertController* vc = [UIAlertController alertControllerWithTitle:message message:nil preferredStyle:UIAlertControllerStyleAlert];[target presentViewController:vc animated:YES completion:^{ [vc dismissViewControllerAnimated:YES completion:NULL];}];
后来发现需要这样写问题解决
UIAlertController* vc = [UIAlertController alertControllerWithTitle:message message:nil preferredStyle:UIAlertControllerStyleAlert]; [target presentViewController:vc animated:YES completion:^{ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [vc dismissViewControllerAnimated:YES completion:NULL]; }); }];
1 0
- Trying to dismiss the presentation controller while transitioning already
- A fatal error occurred while trying to Sysprep the machine
- Warning: Attempt to dismiss from view controller <LoginViewController: 0xbb9c0f0> while a presentat
- IOS:Warning: Attempt to dismiss from view controller <xxxxxxxxxController: 0x15bd67f0> while a prese
- IOS:Warning: Attempt to dismiss from view controller <xxxxxxxxxController: 0x15bd67f0> while a prese
- while a presentation or dismiss is in progress
- attempt to dismiss modal view controller
- a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request
- kettle连接数据库报错:Error occured while trying to connect to the datab
- kettle 通过JDBC 连接SQL Server(Error occurred while trying to connect to the database)
- 错误:Got permission denied while trying to connect to the Docker daemon socket at....
- 错误:Got permission denied while trying to connect to the Docker daemon socket at....
- Trying to install an already registered mbean
- Trying to install an already registered mbean
- an error has occurred while trying to access the log file. logging may not function properly
- 真机上测试出现问题:An error occurred while trying to run the script
- iPad keyboard will not dismiss if modal view controller presentation style is UIModalPresentationFor
- Error while trying to run project
- 正则表达式
- iOS中让Settings Bundle中的变化立即在App中反应出来的两种方法
- 13.4 javascript事件类型
- Java命名规范
- grunt-contrib-connect 中间件middleware属性
- Trying to dismiss the presentation controller while transitioning already
- 电脑使用问题解决Point
- 在导航栏添加搜索框
- FZU 2214 Knapsack problem (01背包)
- Java制作证书的工具keytool用法总结 (转载)
- 初识AOP
- 程序优化方法——CSAPP 读书笔记
- 买车注意事项
- Python代码优化及技巧笔记(一)