调用dismissViewControllerAnimated但不解除ViewController [英] dismissViewControllerAnimated is called but ViewController is not dismissed

查看:508
本文介绍了调用dismissViewControllerAnimated但不解除ViewController的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了 dismissViewControllerAnimated 方法没有关闭视图的问题。

I am having a problems with the dismissViewControllerAnimated method not closing down the view.

发生了什么这里的应用程序是:

What is happening in the app here is:


  • 选择了 ItemViewController 中的单元格。

  • 查看推送编辑为 ItemDetailViewController ,详细信息通过代理发送

  • 用户选择'完成',并通过委托发送事件,以便在中关闭ItemViewController

  • Cell in ItemViewController is selected.
  • View is pushed to ItemDetailViewControllerand details are sent through a delegate
  • User selects 'done' and the event is sent via a delegate to be closed in ItemViewController

所有这些工作除了视图没有被解雇,没有错误。任何人都可以看到有什么问题吗?

All of this works except for the View is not dismissed, there are no errors. Can anyone see what is wrong?

- (void)itemDetailViewControllerDidFinish:(ItemDetailViewController *)controller
{
    NSLog(@"Controller: %@", controller);
    // Returns - Controller: <ItemDetailViewController: 0x6b68b60>

    [self dismissViewControllerAnimated:YES completion:nil];
}


推荐答案

如果你打电话给 [controller.navigationController popViewControllerAnimated:YES] 而不是?

What if you call [controller.navigationController popViewControllerAnimated:YES] instead?

就此而言,如果你打电话给 [controller dismissViewControllerAnimated:YES completion:nil] 而不是自己调用它?

For that matter, what if you call [controller dismissViewControllerAnimated:YES completion:nil] instead of calling it on self?

这篇关于调用dismissViewControllerAnimated但不解除ViewController的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆