IOS Study Notes 20150314, ios20150314
Objective -- class C and object 1 keyword @ interace class definition @ end class end @ implementation class implementation: inherit @ public @ private @ protected internal subclass can access @ proterty declaration member familiar with get, set @ sythesize implement member variable get, set2 function 3 File. class h declaration B. class m implementation 4 Rules 1 class consists of two files. h and. m. 2: The member variables that inherit the three classes must be defined in, the default modifier is @ Protected4. In ObjC, the recommended member variable name starts with _ 5. Note that in ObjC, both the custom class and the system class object must be a pointer. '65' simplified syntax the syntax for declaring property in a get/SET format is: @ property (parameter 1, parameter 2) type name; for example: C code favorites code @ property (nonatomic, retain) U IWindow * window; the parameters are mainly divided into three types: read/write attributes: (readwrite/readonly) setter semantics: (assign/retain/copy) atomicity: (atomicity/nonatomic) each parameter has the following meanings: readwrite: generate the setter \ getter method readonly: only generate simple getter, no setter. Assign: the default type. The setter method directly assigns values without retain operations. retain: the setter method performs the release old value on the parameter, and then retain the new value. Copy: the setter method performs Copy operations. Like retain, nonatomic: multithreading is prohibited, variable protection is disabled, and parameters of the parameter type to improve performance are more complex: retain and copy. The specific analysis is as follows: