Warning: Attempt to present ControllerA and ControllerB whose view is not in the window hierarchy!
来源:互联网 发布:精子优化处理检查 编辑:程序博客网 时间:2024/05/16 12:55
今天在写UIAlertController的时候,在ViewDidLoad中声明并模态推出的时候出现了一个错误:
Warning: Attempt to present <UIAlertController: 0x7f8691f12f80> on <ViewController: 0x7f8691c38d20> which is already presenting <UIAlertController: 0x7f8691e93930>
这个错误网上查了一下,原因是在presnet的时候viewDidLoad还没有执行完成,只有viewDidLoad执行完成之后,正常使用。
在控制器加载的时候,不能使用这个去调用,这样就必须向办法延时才行。
由于是Demo,习惯性的直接写在viewDidLoad中,我最后使用一个Button来出发这个动作,就没有以上错误了。
1 0
- Warning: Attempt to present ControllerA and ControllerB whose view is not in the window hierarchy!
- 对Warning: Attempt to present on whose view is not in the window hierarchy!的解决方案
- Warning: Attempt to present A on B whose view is not in the window hierarchy!
- 对Warning: Attempt to present on whose view is not in the window hierarchy!的解决方案
- 对Warning: Attempt to present on whose view is not in the window hierarchy!的解决方案
- Warning: Attempt to present * on * whose view is not in the window hierarchy!
- Warning: Attempt to present xx on yy whose view is not in the window hierarchy!
- Warning: Attempt to present A on B whose view is not in the window hierarchy!
- Warning: Attempt to present A on B whose view is not in the window hierarchy!
- 对Warning: Attempt to present on whose view is not in the window hierarchy!的解决方案
- 对Warning: Attempt to present on whose view is not in the window hierarchy!的解决方案
- xcode编译Warning: Attempt to present xx on yy whose view is not in the window hierarchy!
- iOS 简单的实现手机号正误的判断(Warning: Attempt to present... whose view is not in the window hierarchy!
- 处理iOS报错: Warning “attempt to present ViewController whose view is not in the window hierarchy”
- iOS - 报错 Warning: Attempt to present <xx: xx> on <xx: xx> whose view is not in the window hierarchy!
- Attempt to present on whose view is not in the window hierarchy!
- Attempt to present on whose view is not in the window hierarchy!
- Attempt to present VC whose view is not in the window hierarchy 解决
- springMVC配置一个通配的url请求,替代@RequestMapping中指定的方式
- fs4412开发板学习笔记(十)
- Java异常捕获之try...catch...finally语句
- Android(5)多选按钮CheckBox、OnClickListener、OnCheckedChangeListener
- fs4412开发板学习笔记(十一)
- Warning: Attempt to present ControllerA and ControllerB whose view is not in the window hierarchy!
- 修改mysql数据库编码格式以支持中文
- Node.js in practice 笔记
- fs4412开发板学习笔记(十二)
- 数据结构学习(一)字符串截取的C语言实现
- 2014找工作总结-机会往往留给有准备的人
- 51nod 1256 乘法逆元 (模板)
- fs4412开发板学习笔记(十三)
- RSA加密解密与签名