ios: push viewcontroller 时出现Presenting view controllers on detached view controllers is discouraged 警告
2015-08-16 19:03
627 查看
原因:a,b,c 三个viewcontroller,a作为根视图,b.view 添加到a上,在b中模态(presentViewController)弹出c.
这种情况就会出现标题的警告
解决方法:
1. [self.view.window.rootViewControllerpresentViewController:controller
animated:YEScompletion:nil];
/*这里一段解释
The reason of this warning is i was presenting a view controller over a small view that is not full size view. Given below is the image of my project. where on click on four option above. User navigate to different childviewcontroller's view.(it works like tabViewcontroller). But the childviewcontroller contains view of small size. So if we present a view from childviewcontroller it gives this warning.
*/
本人也觉得这是个治标不治本的方法,这个方法表面上好像解决了问题,实际可能在特殊情况下引发更严重的bug
2.正确使用viewcontroller,此问题是误用viewcontroller引起的
参考资料:
http://stackoverflow.com/questions/19890761/warning-presenting-view-controllers-on-detached-view-controllers-is-discourage
http://onevcat.com/2012/02/uiviewcontroller/
这种情况就会出现标题的警告
解决方法:
1. [self.view.window.rootViewControllerpresentViewController:controller
animated:YEScompletion:nil];
/*这里一段解释
The reason of this warning is i was presenting a view controller over a small view that is not full size view. Given below is the image of my project. where on click on four option above. User navigate to different childviewcontroller's view.(it works like tabViewcontroller). But the childviewcontroller contains view of small size. So if we present a view from childviewcontroller it gives this warning.
*/
本人也觉得这是个治标不治本的方法,这个方法表面上好像解决了问题,实际可能在特殊情况下引发更严重的bug
2.正确使用viewcontroller,此问题是误用viewcontroller引起的
参考资料:
http://stackoverflow.com/questions/19890761/warning-presenting-view-controllers-on-detached-view-controllers-is-discourage
http://onevcat.com/2012/02/uiviewcontroller/
相关文章推荐
- IOS属性字符串
- 苹果开发者账号的类型
- IOS上架问题解决方案(3)
- 不可变字符串 NSString 的基础使用方法
- IOS项目上架错误解决方案(2)
- 九宫格布局
- ios-文件读写
- iOS页面跳转传递数据之block的使用
- iOS概念入门学习-Foundation框架-Block
- iOS加载程序视图的方式
- IOS事件处理编程指南(一)——概要
- BIOS中断大全
- iOS-表格数据的添加 删除
- IOS- 笔记2(闭包应用例)
- IOS View编程指南笔记
- IOS9应用间跳转
- iOS调用系统通讯录获取姓名电话号码(转)
- IOS地图定位——IOS8/IOS9新特性(未完待续,欢迎给出建议、错误随时更新)
- [转载] iPhone/iOS Core Animation开发总结(CALayer)
- iOS