Attempt to present <TestViewController2: 0x7fd7f8d10f30> on <ViewController: 0x7fd7f8c054c0> whose view is not in the window hierarchy!

当 storyboard里面的 按钮 即连接了 类文件里面的点击方法  又  连接了   storyboard里 另一个  控制器的  modal 

就会出现类似Attempt to present <TestViewController2: 0x7fd7f8d10f30> on <ViewController: 0x7fd7f8c054c0> whose view is not in the window hierarchy!的错误  ,意思是说系统尝试present一个没有在window的层级结构内 存在view的控制器

需要去掉一个方法,不要对一个按钮通过不同形式重复add不同的方法。这样会冲突。

原文地址:https://www.cnblogs.com/isItOk/p/9185601.html