我如何比较viewDidLoad和viewDidAppear? [英] How can I compare viewDidLoad to viewDidAppear?

查看:156
本文介绍了我如何比较viewDidLoad和viewDidAppear?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何比较 viewDidLoad viewDidAppear:



为了避免对 UIViewController 生命周期,这是从大内尔德牧场iOS编程的图:




How can I compare viewDidLoad and viewDidAppear:

解决方案

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:

这篇关于我如何比较viewDidLoad和viewDidAppear?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆