@ 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 ).