How to prevent present modally an active controller?

前端 未结 4 1008
情歌与酒
情歌与酒 2021-01-11 16:11

We have 2 controllers: MainVC and ProfileVC. From MainVC we go to ProfileVC with profileButton press (left item on navigation bar).

In Profile VC we hav

4条回答
  •  不知归路
    2021-01-11 16:45

    I have found kind of solution for this

    - (IBAction)menuButtonPressed:(id)sender
    {
        [self.parentViewController presentViewController:self.menuAlert animated:YES completion:nil];
    }
    

    Alert view sometimes appears on menuVC, but it doesn't crash application and work normally. Answer was found there: Warning :-Presenting view controllers on detached view controllers is discouraged

提交回复
热议问题