the callback sequence of viewDidAppear and viewDidDisappear between two view controllers
Posted
by
olinYY
on Stack Overflow
See other posts from Stack Overflow
or by olinYY
Published on 2011-02-22T07:22:05Z
Indexed on
2011/02/22
7:25 UTC
Read the original article
Hit count: 269
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!
© Stack Overflow or respective owner