xcode编译Warning: Attempt to present xx on yy whose view is not in the window hierarchy!

来源:互联网 发布:淘宝关键词采集器 编辑:程序博客网 时间:2024/05/17 05:11

本文原始地址:xcode编译Warning:

编译xcode的时候报如下警告:

错误代码

Warning: Attempt to present xx  on yy  whose view is not in the window hierarchy!


分析

由于呈现模态视图xx类时,yy视图的view还没有被加载到window中

造成这个原因可能是在yy的viewdidload中呈现xx模态视图。


解决

把presentModalViewController放到viewDidAppear或者viewWillAppear中。

原创粉丝点击