iOS
来源:互联网 发布:seo效果检测步骤包括 编辑:程序博客网 时间:2024/06/05 17:24
在一个block中进行了present vc的行为,结果present失败,出现了warning:
Warning: Attempt to present on whose view is not in the window hierarchy!
在多方查找验证之后,发现下边方案可以解决此问题:
将之前present的语句换成下边的语句
UIViewController *mviewController = [UIApplication sharedApplication].keyWindow.rootViewController; if (mviewController.presentedViewController) { [mviewController.presentedViewController dismissViewControllerAnimated:false completion:^{ [mviewController presentViewController:nav animated:YES completion:nil]; }]; }else { [mviewController presentViewController:nav animated:YES completion:nil]; }
其中的nav时之前创建好的用于present的UINavigationController实例
希望对你有用~
0 0
- iOS
- iOS
- IOS
- iOS
- iOS
- IOS
- ios
- iOS
- iOS
- IOS
- iOS
- ios
- ios ~~~~~
- ios
- IOS
- IOS
- IOS
- ios
- 显示设备相关位图(ddb: device dependent bitmap)
- SpringMVC 数据绑定
- SpringMVC表单标签简介
- (转)[Android_UI控件]Activity、Window、View之间的关系
- Glide图片被拉伸解决方法
- iOS
- 快码表类库DataDictionary
- leetcodeOJ 52. N-Queens II
- hadoop分布式搭建(+zookeeper,6台机器)
- HttpServletRequestWrapper 用法
- MySql查询优化:连接查询排序
- 关于企业的互联网思维
- Mysql
- 加密术 oj