开发者

Can viewDidAppear:animated method be called multiple times for a single presentModalViewController:animated?

开发者 https://www.devze.com 2023-01-12 11:52 出处:网络
I have a view hierarchy like this: nav1 (UINavigationController, top level object in nib) view1 (UIViewController)

I have a view hierarchy like this:

nav1 (UINavigationController, top level object in nib)
  view1 (UIViewController) 
    nav2 (UINavigationController, top level object in nib) 
      view2 (UIViewController)

I called nav2's view[Will/Did][Appear/Disappear] methods in view1's each method. an开发者_如何学编程d when I'm calling presentModalViewController:animated to display nav2 & view2, view2' viewDidAppear called twice.

I treated viewDidAppear will occur only once for a single present/dismiss/push/pop, however I can't know how understand this.


I got solution. It was my fault.

view[Will|Did][Appear|Disappear] routing trick is no longer required. It made my app to call it's subviews' method twice.

*I note this for others having trouble about this situation.

0

精彩评论

暂无评论...
验证码 换一张
取 消