iOS Development-Lazy loading

Source: Internet
Author: User

★ Lazy Loading is delayed loading, that is, when the object needs to use the time to load.       It is actually the get method of overriding the object, and when the system or developer invokes the object's Get method, the object is loaded. ★ Note: 1. If it is lazy loading, you must pay attention to the first to determine if there is already, if not then to instantiate
2. Do not use self in the Getter method. Oneself, because self. Will call getter method, resulting in a dead loop ★ Use lazy Loading benefits: 1. You do not have to write the code of the created object all in the Viewdidload method, the code is more readable
2. Each control's getter method is responsible for the respective instantiation processing, the code is independent of each other, loosely coupled 3. The memory usage of the system will be reduced ★ Reference HTTP://WWW.JIANSHU.COM/P/1927B4310FA6

iOS Development-Lazy loading

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.