码迷,mamicode.com
首页 > 移动开发 > 详细

iOS 生命周期调用顺序

时间:2015-08-08 12:12:24      阅读:290      评论:0      收藏:0      [点我收藏+]

标签:

演示从ViewController到TextViewController的顺序

  1. 单个viewcontroller的顺序如下:

    2015-08-08 11:32:01.601 text[2593:63988] TextViewController loadView

    2015-08-08 11:32:01.602 text[2593:63988] TextViewController viewDidLoad

    2015-08-08 11:32:01.603 text[2593:63988] TextViewController viewWillAppear

    2015-08-08 11:32:01.605 text[2593:63988] TextViewController viewWillLayoutSubviews

    2015-08-08 11:32:01.605 text[2593:63988] TextViewController viewDidLayoutSubviews

    2015-08-08 11:32:01.605 text[2593:63988] TextViewController viewWillLayoutSubviews

    2015-08-08 11:32:01.605 text[2593:63988] TextViewController viewDidLayoutSubviews

    2015-08-08 11:32:02.107 text[2593:63988] TextViewController viewDidAppear

  2. 跳转的情况如下

2015-08-08 11:33:20.888 text[2619:64813] parent viewWillAppear

2015-08-08 11:33:20.892 text[2619:64813] parent viewWillLayoutSubviews

2015-08-08 11:33:20.892 text[2619:64813] parent viewDidLayoutSubviews

2015-08-08 11:33:20.894 text[2619:64813] parent viewDidAppear

2015-08-08 11:33:22.058 text[2619:64813] TextViewController loadView

2015-08-08 11:33:22.058 text[2619:64813] TextViewController viewDidLoad

2015-08-08 11:33:22.059 text[2619:64813] parent viewWillDisappear

2015-08-08 11:33:22.059 text[2619:64813] TextViewController viewWillAppear

2015-08-08 11:33:22.060 text[2619:64813] TextViewController viewWillLayoutSubviews

2015-08-08 11:33:22.061 text[2619:64813] TextViewController viewDidLayoutSubviews

2015-08-08 11:33:22.061 text[2619:64813] parent viewWillLayoutSubviews

2015-08-08 11:33:22.061 text[2619:64813] parent viewDidLayoutSubviews

2015-08-08 11:33:22.061 text[2619:64813] TextViewController viewWillLayoutSubviews

2015-08-08 11:33:22.061 text[2619:64813] TextViewController viewDidLayoutSubviews

2015-08-08 11:33:22.562 text[2619:64813] TextViewController viewDidAppear

2015-08-08 11:33:22.562 text[2619:64813] parent viewDidDisappear


parent代表ViewController

TextViewController代表跳过去后的controller

iOS 生命周期调用顺序

标签:

原文地址:http://my.oschina.net/littleDog/blog/489454

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