viewDidLoad 在 popViewController 调用后被调用吗?

发布于 2024-09-06 12:03:23 字数 40 浏览 2 评论 0原文

当您弹回 UIView 时,viewDidLoad 是否会被调用?

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

独夜无伴 2024-09-13 12:03:23

每当调用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文