// 自定义控制器view,这个方法只有实现了才会执行
- (void)loadView{
[super loadView];
self.view = [[UIView alloc] init];
self.view.backgroundColor = [UIColor orangeColor];
NSLog(@"--1--%s",__func__);
}
// view是懒加载,只要view加载完毕就调用这个方法
- (void)viewDidLoad{
[super viewDidLoad];
NSLog(@"沙盒路径:%@",NSHomeDirectory());
NSLog(@"--2--%s",__func__);
}
// view即将显示
- (void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
NSLog(@"--3--%s",__func__);
}
// view即将开始布局子控件
- (void)viewWillLayoutSubviews{
[super viewWillLayoutSubviews];
NSLog(@"--4--%s",__func__);
}
// view已经完成子控件的布局
- (void)viewDidLayoutSubviews{
[super viewDidLayoutSubviews];
NSLog(@"--5--%s",__func__);
}
// view已经出现
- (void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
NSLog(@"--6--%s",__func__);
}
// view即将消失
- (void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated];
NSLog(@"--7--%s",__func__);
}
// view已经消失
- (void)viewDidDisappear:(BOOL)animated{
[super viewDidDisappear:animated];
NSLog(@"--8--%s",__func__);
}