viewDidAppear在何时调用

  If the view belonging to a view controller is added to a view hierarchy directly, the view controller will not receive this message. If you insert or add a view to the view hierarchy, and it has a view controller, you should send the associated view controller this message directly. Failing to send the view controller this message will prevent any associated animation from being displayed.

  如果包含在一个viewController中的view被直接添加到一个view上,就像这样:
  [view1 addSubView: viewController.view];

  这样我们的viewController就不会收到viewDidAppear:的消息。按这种方式添加视图的话,我们一般需要手动发送这个消息,也就是调用viewController的viewDidAppear方法。否则的话相关的动画都无法正常显示。

  像navigationController的push,或者是presentModelViewController的方法不属于上述方式。而且有明显的动画显示(弹出效果),个人认为是自动调用viewDidAppear方法的。

参考:http://www.cocoachina.com/bbs/simple/?t17845.html

viewDidAppear在何时调用?的更多相关文章

  1. iOS - 转场时 appear 与 disappear 的调用顺序探索

    不同的转场方式 A.B viewDidDisappear调用的流程不同 在A页面跳转到B页面的过程中 A 的 viewDidDisappear 方法和 B 的 viewDidAppear 谁先调用? ...

  2. 【引】objective-c,6:Autorelease Pool

    参考博客: http://blog.leichunfeng.com/blog/2015/05/31/objective-c-autorelease-pool-implementation-princi ...

  3. iOS视图控制器的生命周期

    今天面试有一道面试题因为回答不好,因为也不经常涉及所以有点模糊,我选择了最保守的回答,没有展开写出我对这个问题的理解. 问题:IOS 开发 loadView 和 viewDidLoad 的区别? 经过 ...

  4. 【IOS笔记】Event Delivery: The Responder Chain

    Event Delivery: The Responder Chain  事件分发--响应链 When you design your app, it’s likely that you want t ...

  5. [BS] 小知识点总结-01

    1. UIImageView *imgView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"MainTitle&quo ...

  6. iOS Container View Controller

    一.UIViewController 做iOS开发的经常会和UIViewController打交道,从类名可知UIViewController属于MVC模型中的C(Controller),说的更具体点 ...

  7. UIViewCotroller 的生命周期函数

    Viewcontroller 的所有生命周期函数 重写时 一定要先写 父类 方法 就是(super  +生命周期函数) LoadView ViewDidLoad ViewDidUnload: 在iOS ...

  8. iOS 8 Handoff 开发指南

    (原文:Working with Handoff in iOS 8 作者:Gabriel Theodoropoulos 译者:半圆圆) 我想用下面这一个美妙的场景来开始这篇教程:假象一下你正在Mac上 ...

  9. ios控制器生存周期

    iOS中控制器的生命周期 一般我们在创建控制器的时候,有三种方法. 1.  直接通过代码创建 2.  通过storyboard创建 3.  通过Xib,在创建控制器的时候传入一个Xib文件作为这个控制 ...

随机推荐

  1. ambassador 学习三 限速处理

    与认证类似ambassador 也是委托给三方的其他服务进行限速处理 基本的环境安装可以参考相关文档,主要还是qotm 服务 官方参考实现的简单限速服务 --- apiVersion: v1 kind ...

  2. php in_array的坑

    今天做一个根据用户充值领礼包码的活动,遇到一个问题部分用户领礼包时会一直提示“系统错误,请稍后再试”,这是什么情况,一开始以为接口出错了,一番排查后发现了问题所在,是in_array坑了~~~ 情况大 ...

  3. Androoid studio 2.3 AAPT err(Facade for 596378712): \\?\C:\Users\中文文件夹\.android\build-cache

    错误如下: Error:Some file crunching failed, see logs for details Error:Execution failed for task ':app:m ...

  4. IEEE 754 浮点数在计算机中的表示方法

    IEEE二进制浮点数算术标准(IEEE 754)是20世纪80年代以来最广泛使用的浮点数运算标准,为许多CPU与浮点运算器所采用.这个标准定义了表示浮点数的格式(包括负零-0)与反常值(denorma ...

  5. linux中bin与sbin目录的作用及区别介绍

    linux中bin与sbin目录的作用及区别介绍 本文介绍下,linux中的二个主要目录:bin与sbin,它们的作用与区别,学习linux的朋友可以参考下 在linux系统中,有两个重要的目录:bi ...

  6. Linux vnc服务器操作(启动/停止/重起/自启动)

    8.启动和停止VNC服务1)启动VNC服务命令[root@testdb ~]# /etc/init.d/vncserver startStarting VNC server: 1:rootNew 't ...

  7. configure: error: Please reinstall the libcurl distribution - easy.h should be in <curl-dir>/include/curl/

    编译php出现错误: configure: error: Please reinstall the libcurl distribution - easy.h should be in <cur ...

  8. 1021 docker常用命令和Jenkins搭建

    docker常用命令 1.镜像管理 docker pull (镜像名) # 默认拉取最新版本的镜像 docker pull (镜像名:版本号) #拉取指定版本的镜像 docker push (镜像名) ...

  9. TreeSet函数

    TreeSet类的排序问题   TreeSet支持两种排序方法:自然排序和定制排序.TreeSet默认采用自然排序. 1.自然排序 TreeSet会调用集合元素的compareTo(Object ob ...

  10. android中的一个圆角图片

    RoundedImageView A fast ImageView (and Drawable) that supports rounded corners (and ovals or circles ...