background image

View 和

viewController 的生命周期

 

一、

ViewController 的职责

对内管理与之关联的

View,对外跟其他 ViewController 通信和协调。对于与之关联的

View,ViewController 总是在需要的时候才加载视图,并在不需要的时候卸载视图,所以也
同时担当了管理应用资源的责任

二、

ViewController 的生命周期

View 是指 Controller 的 View。它作为 Controler 的属性,生命周期在 Controller 的生命周期内。
就是说你的

Controller 不能在 view 释放前就释放了。

                     viewController 的生命周期图

                   找软件资料,就到一览软件文库

http://wk.yl1001.com/rj/