我知道这个问题听起来与此类似,但我已经知道解决方法。这更像是一个分析问题。
上面的链接是一个特定于 的问题UITabBarController
,但我也观察了UINavigationController
, 当 I 时的行为pushViewController:... animated:NO
,即。没有动画。
所以我的问题是为什么视图出现在viewDidAppear
方法之后,虽然它的名字暗示,并且定义说,该视图已经出现(定义说视图已经添加到窗口中)。
我在方法中标记了一个断点以查看调用堆栈,这是推送到的日志UINavigationController
:
- (void)viewDidAppear:(BOOL)animated {
[super viewDidApear:animated];
NSLog("..."); // <<<<<Breakpoint here
}
这是日志:
(gdb) next
Single stepping until exit from function -[UINavigationController navigationTransitionView:didEndTransition:fromView:toView:], which has no line number information.
(gdb) next
Single stepping until exit from function -[UINavigationTransitionView _notifyDelegateTransitionDidStopWithContext:], which has no line number information.
(gdb) next
Single stepping until exit from function -[UINavigationTransitionView _navigationTransitionDidStop], which has no line number information.
(gdb) next
Single stepping until exit from function -[UIViewAnimationState sendDelegateAnimationDidStop:finished:], which has no line number information.
(gdb) next
Single stepping until exit from function +[UIViewAnimationState popAnimationState], which has no line number information.
(gdb) next
Single stepping until exit from function dyld_stub_objc_msgSend, which has no line number information.
(gdb) next
Single stepping until exit from function objc_msgSend, which has no line number information.
(gdb) next
Single stepping until exit from function -[NSObject(NSObject) release], which has no line number information.
(gdb) next
Single stepping until exit from function dyld_stub_objc_msgSend, which has no line number information.
(gdb) next
Single stepping until exit from function objc_msgSend, which has no line number information.
(gdb) next
Single stepping until exit from function -[UIViewAnimationState dealloc], which has no line number information.
(gdb) next
Single stepping until exit from function -[UINavigationTransitionView transition:fromView:toView:], which has no line number information.
(gdb) next
Single stepping until exit from function -[UINavigationTransitionView transition:toView:], which has no line number information.
(gdb) next
Single stepping until exit from function -[UINavigationController _startDeferredTransitionIfNeeded], which has no line number information.
(gdb) next
Single stepping until exit from function -[UILayoutContainerView layoutSubviews], which has no line number information.
(gdb) next
Single stepping until exit from function -[CALayer layoutSublayers], which has no line number information.
(gdb) next
Single stepping until exit from function dyld_stub_objc_msgSend, which has no line number information.
(gdb) next
Single stepping until exit from function objc_msgSend, which has no line number information.
(gdb) next
Single stepping until exit from function -[NSObject(NSObject) release], which has no line number information.
(gdb) next
Single stepping until exit from function CALayerLayoutIfNeeded, which has no line number information.