#import "ViewController.h"
@interface ViewController ()
@property (nonatomic, strong) NSArray *array;
@end
@implementation ViewController
/**
* view加载完毕调用
*/
- (void)viewDidLoad
{
[super viewDidLoad];
}
/**
* view即将显示到window上调用
*/
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
}
/**
* view显示完毕调用(已经显示到窗口上)
*/
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
}
/**
* view即将从window上移除(即将看不见)
*/
- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
}
/**
* view从window上完全移除(完全看不见)
*/
- (void)viewDidDisappear:(BOOL)animated
{
[super viewDidDisappear:animated];
}
/**
* view即将销毁的时候调用
*/
- (void)viewWillUnload
{
[super viewWillUnload];
}
/**
* view销毁完毕的时候调用
*/
- (void)viewDidUnload
{
[super viewDidUnload];
// 移除数据
self.array = nil;
}
/**
* 当接收到内存警告的时候
*/
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
}
@end
执行顺序就是上面代码的顺序,从上往下
loadView --> viewDidLoad --> viewWillAppear --> viewDidAppear --> viewWillDisappear --> viewDidDisappear --> viewWillUnload --> viewDidUnload
网友评论