'Tried to pop to a view controller that doesn't exist.'

前端 未结 11 791
清酒与你
清酒与你 2021-02-05 12:13

I am getting this error when I call my method dismissView. Here is the method stub:

-(IBAction)dismissView
{
    RootViewController *rootController = [[RootViewC         


        
11条回答
  •  离开以前
    2021-02-05 12:27

    In my case the problem was that I was in the root ViewController and this works only for VCs that are stacked over it. To pop to the RootViewController use

    navigationController?.popToRootViewController(animated: true)
    

提交回复
热议问题