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

ViewController启动加载过程

时间:2015-06-24 12:22:58      阅读:740      评论:0      收藏:0      [点我收藏+]

标签:

 ViewController加载过程(ShowViewCycle是ViewController.view的subView):

1. -[ViewController initWithNibName:bundle:] [Line 82] nibNameOrNil:(null), nibBundleOrNil:(null)

  ViewController初始化方法, ViewController安一下顺序在 mainBundle 中 (因第二个参数 nibBundle 也指定为 nil) 搜索 NIB 文件: 

    参数nibBundleOrNil:指定nib文件搜索的bundle,默认位mainBundle

    参数nibNameOrNil:指定nib文件的名称,如果不指定,则先搜索View.nib,再搜索 ViewController.nib

2. -[ViewController loadView] [Line 100] 

  在self.view==nil的条件下调用 

3. -[ViewController willMoveToParentViewController:] [Line 363] 

  3.1 -[ShowViewCycle initWithFrame:] [Line 49] 

  3.2 -[ShowViewCycle setNeedsDisplay] [Line 259] 

    ShowViewCycle的属性改变都会触发setNeedsDisplay

  3.3 -[ShowViewCycle setNeedsDisplay] [Line 259] 

  3.4 -[ShowViewCycle setNeedsDisplay] [Line 259] 

  3.5 -[ShowViewCycle willMoveToSuperview:] [Line 174] 

  3.6 -[ShowViewCycle didMoveToSuperview] [Line 181] 

  3.7 -[ShowViewCycle setTranslatesAutoresizingMaskIntoConstraints:] 

    mas_makeConstraints主动触发

  3.8 -[ShowViewCycle isDescendantOfView:] [Line 200]

    addConstraint,会触发该判定,判定一个view是否是另一个view的subview

  3.9 -[ShowViewCycle isDescendantOfView:] [Line 200] 

  3.10-[ShowViewCycle isDescendantOfView:] [Line 200] 

  3.11-[ShowViewCycle isDescendantOfView:] [Line 200] 

4. -[ViewController viewDidLoad] [Line 107] 

5. -[ViewController shouldAutomaticallyForwardAppearanceMethods] [Line 336] 

  返回值如果是NO,子类必须重写- viewWillAppear: -viewDidAppear: -viewWillDisappear: -viewDidDisappear: -willRotateToInterfaceOrientation:duration:  -willAnimateRotationToInterfaceOrientation:duration: -didRotateFromInterfaceOrientation:方法

6. -[ViewController viewWillAppear:] [Line 159] 

7. -[ViewController beginAppearanceTransition:animated:] [Line 298] 

8. -[ViewController shouldAutomaticallyForwardAppearanceMethods] [Line 336] 

  8.1 -[ShowViewCycle willMoveToWindow:] [Line 188] 

  8.2 -[ShowViewCycle translatesAutoresizingMaskIntoConstraints] [Line 393] 

  8.3 -[ShowViewCycle needsUpdateConstraints] [Line 375] 

  8.4 -[ShowViewCycle translatesAutoresizingMaskIntoConstraints] [Line 393] 

  8.5 -[ShowViewCycle isDescendantOfView:] 

  8.6 -[ShowViewCycle translatesAutoresizingMaskIntoConstraints] [Line 393] 

  8.7 -[ShowViewCycle isDescendantOfView:] [Line 200] 

  8.8 -[ShowViewCycle translatesAutoresizingMaskIntoConstraints] [Line 393] 

  8.9 -[ShowViewCycle isDescendantOfView:] [Line 200] 

  8.10-[ShowViewCycle translatesAutoresizingMaskIntoConstraints] [Line 393] 

  8.11-[ShowViewCycle isDescendantOfView:] [Line 200] 

  8.12-[ShowViewCycle translatesAutoresizingMaskIntoConstraints] [Line 393] 

  8.13-[ShowViewCycle didMoveToWindow] [Line 195] 

9. -[ViewController viewWillLayoutSubviews] [Line 188] 

  9.1 -[ShowViewCycle translatesAutoresizingMaskIntoConstraints] [Line 393] 

  9.2 -[ShowViewCycle translatesAutoresizingMaskIntoConstraints] [Line 393] 

  9.3 -[ShowViewCycle translatesAutoresizingMaskIntoConstraints] [Line 393] 

  9.4 -[ShowViewCycle intrinsicContentSize] [Line 451] 

    内在内容的大小

  9.5 -[ShowViewCycle translatesAutoresizingMaskIntoConstraints] [Line 393] 

  9.6 -[ShowViewCycle updateConstraints] [Line 370] 

  9.7 -[ShowViewCycle translatesAutoresizingMaskIntoConstraints] [Line 393] 

  9.8 -[ShowViewCycle alignmentRectInsets] [Line 434] 

  9.9 -[ShowViewCycle translatesAutoresizingMaskIntoConstraints] [Line 393] 

  9.10-[ShowViewCycle alignmentRectInsets] [Line 434] 

  9.11-[ShowViewCycle translatesAutoresizingMaskIntoConstraints] [Line 393] 

  9.12-[ShowViewCycle alignmentRectInsets] [Line 434] 

  9.13-[ShowViewCycle translatesAutoresizingMaskIntoConstraints] [Line 393] 

  9.14-[ShowViewCycle alignmentRectInsets] [Line 434] 

10. -[ViewController updateViewConstraints] [Line 387] 

  10.1 -[ShowViewCycle translatesAutoresizingMaskIntoConstraints] [Line 393] 

  10.2 -[ShowViewCycle alignmentRectInsets] [Line 434] 

11. -[ViewController viewDidLayoutSubviews] [Line 196] 

  11.1 -[ShowViewCycle layoutSubviews] [Line 231] 

  11.2 -[ShowViewCycle drawRect:] [Line 252] 

12. -[ViewController shouldAutomaticallyForwardAppearanceMethods] [Line 336] 

13. -[ViewController viewDidAppear:] [Line 166] 

14. -[ViewController didMoveToParentViewController:] [Line 370] 

15. -[ViewController viewWillLayoutSubviews] [Line 188] 

16. -[ViewController updateViewConstraints] [Line 387] 

  16.1 -[ShowViewCycle translatesAutoresizingMaskIntoConstraints] [Line 393] 

  16.2 -[ShowViewCycle alignmentRectInsets] [Line 434] 

17. -[ViewController viewDidLayoutSubviews] [Line 196] 

ViewController启动加载过程

标签:

原文地址:http://www.cnblogs.com/StarMud/p/4597215.html

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