2

I have a UIViewController, ViewControllerA that is presented as a modal view controller from a RootViewController class.

ViewControllerA then presents another modal controller class, ModalViewControllerB and I'd like to know whether the calls to ViewControllerA's

- (void)viewWillDisappear:(BOOL)animated 

is due to ModalViewControllerB appearing on screen or because ViewControllerA is being dismissed.

Is there a built-in iOS way to figure this out?

4

1 回答 1

8

呼叫[self isBeingDismissed]将区分您正在谈论的两种情况。

于 2013-05-18T02:24:18.200 回答