原因: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引起的
參考資料:
