A View Controller Instantiation

来源:互联网 发布:mariadb mysql 对比 编辑:程序博客网 时间:2024/06/01 18:25

A View Controller Instantiates Its ViewHierarchy When Its View is Accessed

Whenever somepart of your app asks the view controller for its view object and that objectis not currently in memory, the view controller loads the view hierarchy intomemory and stores it in its view property for future reference. The steps that occur during theload cycle are:

1.  The view controller calls its loadView method. The default implementation of the loadView method does one of two things:

·      If the view controller is associated with a storyboard, it loadsthe views from the storyboard.

·      If the view controller is not associated with a storyboard, anempty UIView object is created and assigned to the view property.

2.  The view controller calls its viewDidLoad method, which enables your subclass to perform any additional load-time tasks.


0 0
原创粉丝点击