Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当您弹回 UIView 时是否会调用 viewDidLoad?
每当调用 loadView 时都会调用 viewDidLoad。每当从 UIViewController 请求视图并且当前为 nil 时,都会调用 loadView。
如果你弹出一个 UIViewController 并且 view 属性为 nil,loadView 和 viewDidLoad 将被调用。如果视图从未加载或在另一个视图控制器在屏幕上时被卸载,则视图可能为 nil。如果同时推送多个视图控制器,它可能永远不会被加载。