Some trivia in objective-c (update)

Source: Internet
Author: User

  1. Object (the instance object of the Class). In short, it's a piece of data in memory that holds the value of an attribute through an instance variable .

  2. The use of the object. Create object------Send Message---------Release object (sets the variable that points to the object to nil)

    Note: The use of objects is not the direct manipulation of the object itself, but the manipulation of pointers to Objects!!! ( For example, the object contained in the array is not the object itself, but a pointer to the object)

  3. Nil is a pointer to the value W of 0, and nil is a pointer indicating that no object is pointing. (corresponds to NULL in Null,java in C language)

  4. Instance variables && Access instance variables && Point syntax && class methods and instance methods && specifying the method of an accident

  5. Instancetype and ID: The former means that the method return type and the calling method object type are the same, used in the Init method

    The latter represents " pointers to arbitrary objects ". (void*)

  6. Self: does not need to declare, exists in the method, is an implicit local variable, used to send the message to the object itself

  7. "@[]" syntax: can only be used to create non-variable groups!

Some trivia in objective-c (update)

Related Article

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.