Objective-C keywords

Source: Internet
Author: User

@ Interface => start to define a class.

@ End => end

 

 

@ Implementation => class implementation

@ End => end

 

 

# Import => reference header files

 

@ Property => Objective-C 2.0 syntax, defining an attribute

 

ID

ID and void * are not exactly the same. AboveCode, ID is pointing to struct
An objc_object pointer. This basically means that ID is an object that points to any one that inherits the object (or nsobject) class. Note that ID
Is a pointer, so you do not need to add a star number when using ID. For example, Id Foo = nil defines an Nil pointer, which points to any subclass of nsobject. And ID
* Foo = nil defines a pointer, which points to another pointer and points to a subclass of nsobject.

 

Nil

Nil is the same as null in C, which is defined in objc/objc. h. Nil indicates an Objctive-C object. The pointer of this object points to null (nothing is null ).

Nil

Nil and nil in the upper-case letters are a little different. Nil defines a class (class rather than an object) pointing to null ).

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.