iOS key words

Source: Internet
Author: User

Self: Similar to the this pointer in Java, is a shadow parameter, pointing to the class of the currently calling method

Super: Calling methods of the parent class

if (Self=[super init]), is a general notation, the assignment and measurement of 0 is to prevent the superclass in the initialization process changes, return different objects, and the implementation of the parent class related to the initialization of resources.

Atomic: Atomic access, which is locked when the property is assigned a value. When setting the @property property, the default is atomic, which provides multithreading security

Nonatomic: Non-atomic access, no lock on attribute assignment. Multi-threaded concurrent access improves performance, but variables are easily modified to make the program crash

Assign: Simple assignment, without changing the index count. Applies to the underlying data type, such as NSNumber

Copy: Creates a new object with an index count of 1 and releases the old object. This property is used only for objects that implement the <NSCoding> protocol.

Retain: Similar to copy, creates a new object with an index count of 1 and releases the old object. Retain is a copy pointer, copy creates a new memory and then makes a value reference. For complex data types, such as Nsarray, the effect is approximate. Although copy creates a new memory, each element in the array is simply a pointer to the element that was copied.

iOS key words

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.