[英]dismissModalViewControllerAnimated also dismisses the view controller that calls it
I've got a view controller which is presented as a modal view controller on startup by the delegate. 我有一个视图控制器,它在委托启动时作为模态视图控制器呈现。 This view controller has an option to select an image using a UIImagePickerController which is presented using
presentModalViewControllerAnimated
. 该视图控制器具有使用UIImagePickerController选择图像的选项,该图像通过
presentModalViewControllerAnimated
呈现。 After this I implement the 在此之后,我实现了
imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
method and call dismissModalViewControllerAnimated
on it, but this dismisses both of the modal view controllers. 方法,并在其上调用
dismissModalViewControllerAnimated
,但这会关闭两个模态视图控制器。 I can't seem to keep the first view controller open when the second is closed. 关闭第二个视图控制器后,我似乎无法保持第一个视图控制器处于打开状态。
Who are you calling dismissModalViewControllerAnimated on? 您在谁身上调用dismissModalViewControllerAnimated? You want to call it on the view controller that presented the modal view you want to dismiss.
您想在提供要关闭的模态视图的视图控制器上调用它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.