Learning iOS Development UI--management of the Controller

Source: Internet
Author: User

How the controller is created:

1. Code directly created Zyviewcontroller * Vc = [[Zyviewcontroller alloc] init];

2. By Storyboard:

Uistoryboard *storyboard = [Uistoryboard storyboardwithname:@ "Test" bundle:nil]; Load the storyboard file first

Zyviewcontroller *VC = [Storyboard Instantiateinitialviewcontroller]; Initialize the initial controller (the controller that the arrow points to)

Zyviewcontroller *VC = [Storyboard instantiateviewcontrollerwithidentifier:@ "NJ"]; (via IdentiFi initialization controller)

3. By xib

Zyviewcontroller *VC = [[Zyviewcontroller alloc] initwithnibname:@ "Zyviewcontroller" bundle:nil];

If the controller is defined in the Proxy method Didfinshedlaunch method of UIApplication, and the main controller is set, the content of the code wearing is finally displayed, the reason Storybord is automatically converted into code, Appears in front of the manual creation, so it is overwritten ******************

The creation of the Controller view (Loadview cannot invoke [super Loadview] in it if the equivalent of no rewrite Loadview is called, if overriding Loadview must create a view inside, Otherwise, Xcode will not be prompted to find Rootview)

Controller view is lazy loading, when used to load, Controller view life cycle method Execution order

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.