zoukankan      html  css  js  c++  java
  • ViewController 生命周期

    单个viewController的生命周期

    - initWithCoder:(NSCoder *)aDecoder:(如果使用storyboard或者xib)
    - loadView:加载view
    - viewDidLoad:view加载完毕
    - viewWillAppear:控制器的view将要显示
    - viewWillLayoutSubviews:控制器的view将要布局子控件
    - viewDidLayoutSubviews:控制器的view布局子控件完成  
    - viewDidAppear:控制器的view完全显示
    - viewWillDisappear:控制器的view即将消失的时候
    - viewDidDisappear:控制器的view完全消失的时候
    - dealloc 控制器销毁

    两个控制器AB进行跳转调用顺序:

    A控制器先展示调用

     - [ViewControllerA loadView]
     - [ViewControllerA viewWillAppear:]
     - [ViewControllerA viewWillLayoutSubviews]
     - [ViewControllerA viewDidLayoutSubviews]
     - [ViewControllerA viewDidAppear:]

    B控制器跳转调用顺序

     - [ViewControllerB loadView]
     - [ViewControllerB viewDidLoad]
     - [ViewControllerA viewWillDisappear:]
     - [ViewControllerB viewWillAppear:]
     - [ViewControllerB viewWillLayoutSubviews]
     - [ViewControllerB viewDidLayoutSubviews]
     - [ViewControllerA viewDidDisappear:]
     - [ViewControllerB viewDidAppear:]

    B控制器返回A顺序

     - [ViewControllerB viewWillDisappear:]
     - [ViewControllerA viewWillAppear:]
     - [ViewControllerB viewDidDisappear:]
     - [ViewControllerA viewDidAppear:]
    在北京的灯中,有一盏是我家的。这个梦何时可以实现?哪怕微微亮。北京就像魔鬼训练营,有能力的留,没能力的走……
  • 相关阅读:
    面经-新浪
    面经-中兴
    面经-趋势科技
    面经-酷家乐
    面经-大华
    面经-明略科技
    面经-小米
    面经-虹软
    coroutine
    Coroutine 终止协程和异常处理
  • 原文地址:https://www.cnblogs.com/huangzs/p/15603135.html
Copyright © 2011-2022 走看看