the callback sequence of viewDidAppear and viewDidDisappear between two view controllers
- by olinYY
As I know, there are at least two ways to present a UIViewController on another UIViewController, first is using presentModalViewController:animated: on UIViewController, another is using pushViewController:animated: on UINavigationController, it seems when 2 view controller changing their appearance, the invoke sequence of appear/disappear callbacks are different. Following is an example, A is a UINavigationController, and B is a normal view controller, the actual callback sequence are:
(1) A using presentModalViewController:animated: to show B:
[B viewWillAppear];
[A viewWillDisappear];
[B viewDidAppear];
[A viewDidDisappear];
(2) A using pushViewController:animated: to show B:
[A viewWillDisappear];
[B viewWillAppear];
[A viewDidDisappear];
[B viewDidAppear];
So my question is that, are these different callback sequence stable, or there are no definite sequence we can rely on? If they are stable, is there any document mentions this behavior?
Can anyone help? Thanks in advanced!