Lazy Load Delay Loading

Source: Internet
Author: User

1.

Strong for general objects

Weak for UI Objects

Assign for structural type

%02d integers save 2 bits, not enough of the front fill 0

Duplicate Code encapsulation extraction, the duplication of things extracted to write to the function, the different things as parameters

/**

*/

Document comments

2.

Delayed loading of data (lazy loading) (the way in which attributes are initialized in the get method), loaded with time, adding a get method

-(nsarray *) array

{

if (_array = = nil)// is never initialized

{

Initialize data }

Return _array

}

If the first load is _array , the Get method is not called , and the resulting array is empty,

Self.array is required for deferred load calls

Lazy Load Delay 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.