Features of the OC compiler: When declaring a member variable, the compiler produces a hard-coded offset that represents the length of the start address of the variable distance from the memory area where the object resides. OC takes this offset as a special variable for the class object, and when it is found in runtime, it can always generate the correct offset.
@property properties: Without any manual action, this property first automatically generates getter and setter methods, and generates member variables for the corresponding property "_ Field"
The semantics of memory management in @property:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/71/B3/wKiom1XW1i_TE_HeAAQcTw1X8JI186.jpg "style=" float: none; "title=" 1.jpg "alt=" Wkiom1xw1i_te_heaaqctw1x8ji186.jpg "/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/71/AF/wKioL1XW2EKA3shhAAKnsIq6sPU973.jpg "style=" float: none; "title=" 2.jpg "alt=" Wkiol1xw2eka3shhaaknsiq6spu973.jpg "/>
4. About the principle of using point syntax: In the initialization method or DEALLOC, use member variables, do not use point syntax (do not know why), access member variables inside the object, write data using point syntax, so as to facilitate the expression of memory management semantics, read data when possible to use _ member variables.
5. In NSObject, determine whether two objects are equal: Call method Isequalto, its algorithm is divided into three steps:
First, determine if the pointers to two objects are the same
Second, if the pointers are different, determine whether the two classes are the same
Third, if the class is the same, then you can determine whether each property is the same
When these judgments are finished, the hash code is judged to be the same
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/71/B1/wKioL1XW_B-jmCe0AACTOAXsTM8772.jpg "title=" 3.jpg " alt= "Wkiol1xw_b-jmce0aactoaxstm8772.jpg"/>
Read effective Objective C Summary (ii)