// 自定義控制器view,這個方法只有實現(xiàn)了才會執(zhí)行
- (void)loadView{
[super loadView];
self.view = [[UIView alloc] init];
self.view.backgroundColor = [UIColor orangeColor];
NSLog(@"--1--%s",__func__);
}
// view是懶加載,只要view加載完畢就調(diào)用這個方法
- (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已經(jīng)完成子控件的布局
- (void)viewDidLayoutSubviews{
[super viewDidLayoutSubviews];
NSLog(@"--5--%s",__func__);
}
// view已經(jīng)出現(xiàn)
- (void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
NSLog(@"--6--%s",__func__);
}
// view即將消失
- (void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated];
NSLog(@"--7--%s",__func__);
}
// view已經(jīng)消失
- (void)viewDidDisappear:(BOOL)animated{
[super viewDidDisappear:animated];
NSLog(@"--8--%s",__func__);
}