1.To preserve the benefit of lazy loading, you should never access the VIEW property of a view controller in initWithNibName:bundle:.Asking for the view in the initializer will cause the view controller to load its VIEW prematurely.指针
2. viewDidLoad和viewWillAppear:view controller收到viewDidLoad消息时,是在这个view controller的NIB文件已经加载后,此时view controller全部的指针都指向了正确的对象。对象
viewWillAppear消息发送给view controller时,是在它的view被添加到window以前。rem
1) 若是在程序运行过程当中只须要配置一次的,在viewDidload中实现。it
2) 若是这些配置须要在每次这个view controller出如今屏幕上时都要从新作一次,须要在viewWillAppear中实现。配置