码迷,mamicode.com
首页 > 其他好文 > 详细

UIViewController函数调用顺序

时间:2018-12-04 21:09:40      阅读:218      评论:0      收藏:0      [点我收藏+]

标签:traints   %s   cti   ima   sub   ons   ted   super   type   

/*********** 0 执行1次而已 ******************/
+ (void)load {
    NSLog(@" 0:%s", __func__);
}
 
/*********** 1 执行1次而已 ******************/
+ (void)initialize {
    NSLog(@" 1:%s", __func__);
}

/*********** 常规的对象函数 ******************/
/// 2
- (instancetype)init {
    self = [super init];
    if (self) {
        NSLog(@" 2:%s", __func__);
    }
    return self;
}
 
/// 3
- (void)loadView {
    [super loadView];
    NSLog(@" 3:%s", __func__);
}
 
/// 4
- (void)viewDidLoad {
    [super viewDidLoad];
    NSLog(@" 4:%s", __func__);
}
 
/// 5
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    NSLog(@" 5:%s", __func__);
}
 
/// 6
- (void)updateViewConstraints {
    [super updateViewConstraints];
    NSLog(@" 6:%s", __func__);
}
 
/// 7
- (void)viewWillLayoutSubviews {
    [super viewWillLayoutSubviews];
    NSLog(@" 7:%s", __func__);
}
 
/// 8
- (void)viewDidLayoutSubviews {
    [super viewDidLayoutSubviews];
    NSLog(@" 8:%s", __func__);
}
 
/// 9
- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    NSLog(@" 9:%s", __func__);
}
 
/// 10
- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    NSLog(@"10:%s", __func__);
}
 
/// 11
- (void)viewDidDisappear:(BOOL)animated {
    [super viewDidDisappear:animated];
    NSLog(@"11:%s", __func__);
}

UIViewController函数调用顺序

标签:traints   %s   cti   ima   sub   ons   ted   super   type   

原文地址:https://www.cnblogs.com/CH520/p/9551143.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!