美文网首页
viewDidLoad、viewWillAppear执行顺序

viewDidLoad、viewWillAppear执行顺序

作者: 寂寞先森666 | 来源:发表于2019-08-13 16:01 被阅读0次

    viewController 里面

    - (void)viewDidLoad {
        [super viewDidLoad];
        secondViewController * secondVC  = [[secondViewController alloc]init];
        NSLog(@"准备push");//不push后面的都不发生
        [self.navigationController pushViewController:secondVC animated:YES];
    }
    

    secondViewController 里面

    @implementation secondViewController
    - (void)viewDidLoad {
        [super viewDidLoad];
        NSLog(@"viewDidLoad");
    }
    -(void)viewWillAppear:(BOOL)animated
    {
        [super viewWillAppear:animated];
        NSLog(@"viewWillAppear");
    }
    

    2019-08-13 15:54:56.614057+0800 yyModel测试[92403:6058217] 准备push
    2019-08-13 15:54:56.647362+0800 yyModel测试[92403:6058217] viewDidLoad
    2019-08-13 15:54:56.647614+0800 yyModel测试[92403:6058217] viewWillAppear

    相关文章

      网友评论

          本文标题:viewDidLoad、viewWillAppear执行顺序

          本文链接:https://www.haomeiwen.com/subject/zfrbjctx.html