dismissViewControllerAnimated does not work within a block

前端 未结 4 750
野趣味
野趣味 2021-01-02 04:36

I try to close a UIViewController after an UIAlertController has been shown.

This is my code:

UIAlertController *alertContr         


        
4条回答
  •  执念已碎
    2021-01-02 05:09

    In case someone is having the same issue. I pushed the UIViewController, I didn't present it with presentViewController:animated:completion:. That's why [self.navigationController popViewControllerAnimated:YES]; should be used instead.

    The strange thing is that [self dismissViewControllerAnimated:YES completion:nil]; worked outside of the block and didn't inside, I have no explanation for this...

提交回复
热议问题