一.系统方法.
view加载完毕
- (void)viewDidLoad
{
[super viewDidLoad];
NSLog(@"WKOneViewController-viewDidLoad");
}
view即将显示到window上
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
NSLog(@"WKOneViewController-viewWillAppear");
}
view显示完毕(已经显示到窗口)
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
NSLog(@"WKOneViewController-viewDidAppear");
}
view即将从window上移除(即将看不见)
- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
NSLog(@"WKOneViewController-viewWillDisappear");
}
view从window上完全移除(完全看不见)
- (void)viewDidDisappear:(BOOL)animated
{
[super viewDidDisappear:animated];
NSLog(@"WKOneViewController-viewDidDisappear");
}
view即将销毁的时候调用
- (void)viewWillUnload
{
[super viewWillUnload];
}
view销毁完毕的时候调用
- (void)viewDidUnload
{
[super viewDidUnload];
}
当接收到内存警告的时候
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
}
二. 苹果对于内存警告官方图示
内存警告处理.png
三.对于系统控制器View的整个生命周期顺序图解.
生命周期方法.png
网友评论