Attempt to present UIViewController on UIViewController whose view is not in the window hierarchy

后端 未结 30 3496
一整个雨季
一整个雨季 2020-11-21 23:39

Just started using Xcode 4.5 and I got this error in the console:

Warning: Attempt to present < finishViewController: 0x1e56e0a0 > on < ViewCont

30条回答
  •  耶瑟儿~
    2020-11-22 00:12

    Another potential cause:

    I had this issue when I was accidentally presenting the same view controller twice. (Once with performSegueWithIdentifer:sender: which was called when the button was pressed, and a second time with a segue connected directly to the button).

    Effectively, two segues were firing at the same time, and I got the error: Attempt to present X on Y whose view is not in the window hierarchy!

提交回复
热议问题