Property key collation in @property

Source: Internet
Author: User

  • Atomicity of Nonatomic/atomic

      • By default, the method synthesized by the compiler ensures its atomicity (atomicity) through the locking mechanism. If you have a nonatomic trait, you do not use a sync lock.

  • Read/write Permissions readwrite/readonly

  • Memory Management semantics

      • Assign The Set method only operates on simple assignments for the scalar type, cgfloat, or nsinteger, etc.

      • Strong "Owning relationship" sets a new value for this property, the set method retains the new value, releases the old value, and then sets the new value up

      • Weak When a non-owning relationship sets a new value for this property, the setting method neither preserves the new value nor releases the old value. This trait is similar to assign, but the property is also emptied when the object it refers to is destroyed (nil out)

      • unsafe_unretained The semantics of this trait are the same as assign, but it applies to the object type, which expresses a "non-owning relationship" ("not reserved", unretained), when the target object is destroyed , property values are not automatically emptied ("unsafe", unsafe), which differs from weak

      • copy of this trait expresses a relationship similar to strong. However, the set method does not retain the new value, but instead copies the copy

  • Method Name

      • Getter=<name>

        • @property (nonatomic, Getter=ison) BOOL on;

      • Setter=<name> not very common

Property key collation in @property

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.