How can I compare viewDidLoad to viewDidAppear? [duplicate]

假装没事ソ 提交于 2019-12-20 07:58:07

问题


How can I compare viewDidLoad and viewDidAppear:


回答1:


The best thing to do is to implement both methods in a view controller that loads a view with subviews (easiest is from a NIB) and put a breakpoint into each method. When the app stops on each breakpoint, look at the Variables view in the debugger and see what objects have been instantiated.

To eliminate confusion about the UIViewController lifecycle, here's a diagram taken from Big Nerd Ranch iOS Programming:



来源:https://stackoverflow.com/questions/15247217/how-can-i-compare-viewdidload-to-viewdidappear

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!