在 popViewController 调用后会调用 viewDidLoad 吗? [英] does viewDidLoad get called after a popViewController call?

查看:46
本文介绍了在 popViewController 调用后会调用 viewDidLoad 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当您返回 UIView 时是否调用 viewDidLoad?

Does viewDidLoad get called when you're popping back to a UIView?

推荐答案

viewDidLoad 在 loadView 被调用时被调用.每当从 UIViewController 请求视图并且它当前为零时,就会调用 loadView.

viewDidLoad gets called whenever loadView is called. loadView is called whenever the view is requested from a UIViewController and it is currently nil.

如果你弹出一个 UIViewController 并且 view 属性为 nil,loadView 和 viewDidLoad 将被调用.如果视图从未加载或在另一个视图控制器在屏幕上时被卸载,则视图可能为零.如果同时推送多个视图控制器,它可能永远不会被加载.

If you pop to a UIViewController and the view property is nil, loadView and hence viewDidLoad will be called. The view could be nil if it was never loaded or if it was unloaded while another view controller was on screen. It might never have been loaded if several view controllers were pushed at once.

这篇关于在 popViewController 调用后会调用 viewDidLoad 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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