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

前端 未结 7 1227
半阙折子戏
半阙折子戏 2020-11-30 05:29

I\'m trying to make a modal view controller in my app delegate (I created a function called showLoginView). But whenever I try to call it I get a warning in XCode:



        
7条回答
  •  长情又很酷
    2020-11-30 06:19

    You can NSLog(@"%@", self.window.rootViewController), and see what the rootViewController really is.

    I came into this problem, when the rootViewController is a normal UIViewController. Replace it with a UINavigationController, wish it will help.

提交回复
热议问题