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

前端 未结 11 945
清酒与你
清酒与你 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:33

    When using Push Segues you can easily go back to the root using this method:

    [self.navigationController popToRootViewControllerAnimated:YES];
    

    When using Modal Segues (because of the word dismiss in the question and as a general reference) you can dismiss the view controller using this method:

    [self dismissViewControllerAnimated:YES completion:nil];
    

提交回复
热议问题