Self keyword in ios

Source: Internet
Author: User

Self keyword

1, the self in the instance method is the first address of the object.

2, the self in the class method is class.
Although self is used within the same class, self has a different interpretation. Self in the class method can be translated into class self, and self in the instance method should be translated into object self. Self in the class method and self in the instance method are fundamentally different, even though their names are called self.

The popular point is that if the object invocation in the object method represents the current object, if it is called by the class in the class method then it represents the current class.


Self keyword in ios

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.