Ios 检测ParentViewController中ChildViewController的弹出窗口

Ios 检测ParentViewController中ChildViewController的弹出窗口,ios,uinavigationcontroller,Ios,Uinavigationcontroller,对不起,我的问题不清楚。但是我想通过调用[self.navigationController-popViewControllerAnimated:YES]来检测当我的父ViewConroller显示时的情况方法 我知道Workaroud会在弹出时间将变量传递给parentviewcontroller,但如果有任何默认方法检测它,那么它比Workaround好。您可以将父vc指定为的代理。在 您可以检查is self==viewController。如果是,则在调用导航控制器中的一个pop方法后显

对不起,我的问题不清楚。但是我想通过调用
[self.navigationController-popViewControllerAnimated:YES]来检测当我的父ViewConroller显示时的情况方法


我知道Workaroud会在弹出时间将变量传递给parentviewcontroller,但如果有任何默认方法检测它,那么它比Workaround好。

您可以将父vc指定为的代理。在


您可以检查is self==viewController。如果是,则在调用导航控制器中的一个pop方法后显示此vc。

父视图控制器,您是指rootViewController吗?@n00bProgrammer thanx作为答复,否是导航堆栈中的vc之一。请查看
isMovingFromParentViewController
isMovingToParentViewController
。第一个在视图控制器被推到
UINavigationController
的导航堆栈上时调用,第二个在VC被弹出时调用。因此,VC的
视图中将出现
if([self isMovingToParentViewController])
,它将告诉您VC在被推或弹出后是否出现。@n00b我正在检查,Thanx@n00bProgrammer有一个问题是,这会在childviewcontroller或推送它的viewcontroller中检测到pop吗?
navigationController:willShowViewController:animated: