IOS容器视图是否为父级?

IOS容器视图是否为父级?,ios,objective-c,Ios,Objective C,我有3个视图控制器。控制器A调用B。B有一个容器视图,其中包含C-A表视图控制器。如何在C中使用didSelectRowAtIndexPath方法来关闭B和C并返回A 我试过这个: [self.navigationController.parentViewController dismissViewControllerAnimated:YES completion:nil]; 这: 这是: [self dismissViewControllerAnimated:YES completion:n

我有3个视图控制器。控制器A调用B。B有一个容器视图,其中包含C-A表视图控制器。如何在C中使用didSelectRowAtIndexPath方法来关闭B和C并返回A

我试过这个:

[self.navigationController.parentViewController dismissViewControllerAnimated:YES completion:nil];
这:

这是:

[self dismissViewControllerAnimated:YES completion:nil];

这些都不管用

听起来好像是C的父母需要解雇,但从你的帖子中还不清楚导航控制器在哪里。您是否尝试过[self.parentViewController dismissViewControllerAnimated:YES完成:nil];或者,[self.parentViewController.navigationController解除ViewControllerInitiated:是完成:无];我相信是的,不过我找到了一个不同的解决方案。我将父对象(B)作为C的委托,并实现了dataFromController方法。在该方法中,我添加了代码“[self.navigationController popViewControllerAnimated:NO];”。因为我使用的是ARC,这会自动释放C的内存吗?
[self dismissViewControllerAnimated:YES completion:nil];