Note: (because there is no apple around the first summary, the relevant code after the complement) three, description method1.-descriotion Method
When you use NSLog and%@ to output an object, the object's -description method is called and the return value is returned for output .
2.+description Method
When you use NSLog and %@ to output a class object, the Class object +description method is called, and the return value is obtained for output
3. Modify the default output of the NSLog
Rewrite the -description or +description method.
4. Dead Loop traps
If you use NSLog in the -description method, print self .
Iv. SEL1. Where to store the method
The list of methods for each class is stored in the class object
Each method has an object of the corresponding SEL type
The address of the method can be found based on a Sel object, and the method is called
Definition of SEL type
typedef struct OBJC_SELECTOR *sel;
Creation of 2.SEL objects
SEL s = @selector (test);
SEL s2 = nsselectorfromstring (@ "Test")
3.SELother uses of the object
Convert Sel object to NSString Object
NSString *str = Nsstringfromselector (@selector (test));
Person *p = [person new];
Call the test method of the object P
[P Performselector: @selector (test)];
The syntax specific to the last OC