viewDidLoad 在 popViewController 调用后被调用吗?
当您弹回 UIView 时,viewDidLoad 是否会被调用?
Does viewDidLoad get called when you're popping back to a UIView?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
每当调用 loadView 时,viewDidLoad 就会被调用。每当从 UIViewController 请求视图并且当前视图为零时,就会调用 loadView。
如果你弹出一个 UIViewController 并且 view 属性为 nil,那么 loadView 和 viewDidLoad 将被调用。如果视图从未加载或在另一个视图控制器位于屏幕上时被卸载,则视图可能为零。如果同时推送多个视图控制器,它可能永远不会被加载。
viewDidLoad gets called whenever loadView is called. loadView is called whenever the view is requested from a UIViewController and it is currently nil.
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.