<pre>
控制器View的 命周期 法:只要是控制器的 命周期 法,都是以view开头.
控制器View加载完成时调
-(void)viewDidLoad {
[super viewDidLoad];
}
控制器的View显 完成时调
-(void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
}
控制器的View即将显 的时候调
-(void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
}
控制器的View完全消失的时候调
-(void)viewDidDisappear:(BOOL)animated{
[super viewDidDisappear:animated];
}
控制器的View即将消失的时候调 .
-(void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
}
布局控制器View的 控件完成时调
-(void)viewDidLayoutSubviews{
[super viewDidLayoutSubviews];
}
将要布局控制器的View 控件的时候就会调 .
-(void)viewWillLayoutSubviews {
[super viewWillLayoutSubviews];
}
ARC的生命周期 viewDidLoad->viewWillAppear->viewWillLayoutSubviews->viewDidLayoutSubviews- >viewDidAppear-> viewWillDisappear->viewDidDisappear
在 ARC当中. 当前控制器的View即将被销毁的时候会调
-(void)viewWillUnload {
[super viewWillUnload];
}
当前控制器的View被销毁的时候会调
-(void)viewDidUnload {
[super viewDidUnload];
清空界 上的数据.
self.dataList = nil;
}
viewDidLoad --> *viewWillAppear * --> viewWillLayoutSubviews --> viewDidLayoutSubviews --> viewDidAppear --> viewWillDisappear --> viewDidDisappear --> 接收到内存警告 --> *viewWillUnload *--> 释放View --> viewDidUnload