现在的位置: 首页 > 综合 > 正文

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

2013年09月04日 ⁄ 综合 ⁄ 共 245字 ⁄ 字号 评论关闭

本文原始地址: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中。

抱歉!评论已关闭.