missModalViewControllerAnimated 也会关闭调用它的视图控制器

发布于 2024-12-18 05:56:05 字数 386 浏览 0 评论 0原文

我有一个视图控制器,它在委托启动时呈现为模式视图控制器。该视图控制器可以选择使用 UIImagePickerController 选择图像,该图像使用 presentModalViewControllerAnimated 呈现。之后,我实现该

imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info 

方法并对其调用 dismissModalViewControllerAnimated,但这会解除两个模式视图控制器。当第二个视图控制器关闭时,我似乎无法保持第一个视图控制器打开。

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. After this I implement the

imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info 

method and call dismissModalViewControllerAnimatedon it, but this dismisses both of the modal view controllers. I can't seem to keep the first view controller open when the second is closed.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风吹短裙飘 2024-12-25 05:56:05

你在给谁打电话dismissModalViewControllerAnimated?您想在呈现要关闭的模态视图的视图控制器上调用它。

Who are you calling dismissModalViewControllerAnimated on? You want to call it on the view controller that presented the modal view you want to dismiss.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文