dismiss modalviewcontroller from another modalviewcontroller

后端 未结 6 1691
天涯浪人
天涯浪人 2020-12-06 08:15

I am presenting a modalviewcontroller from another modalviewcontroller. When I dismiss the second modalviewcontroller both the first and second modalviewcontroller should ge

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-06 09:02

    The dismissModalViewControllerAnimated: method is part of the UIViewController class, not the of UIView. So you need to do

    [self.parentViewController dismissModalViewControllerAnimated:YES];
    

    instead of calling it on self.view.superview.

提交回复
热议问题