Looking to understand the iOS UIViewController lifecycle

前端 未结 11 2088
情深已故
情深已故 2020-11-21 22:33

Could you explain me the correct manner to manage the UIViewController lifecycle?

In particular, I would like to know how to use Initialize

11条回答
  •  一个人的身影
    2020-11-21 23:11

    Haider's answer is correct for pre-iOS 6. However, as of iOS 6 viewDidUnload and viewWillUnload are never called. The docs state: "Views are no longer purged under low-memory conditions and so this method is never called."

提交回复
热议问题