1.expand
expand a Class, create a objective-c file
File Type:Category
Class:the target class
Aim:add a method without changing the original class
if we expand the NSobject,all class can use the expanded method
we can't use the same method Names bewtteen those expand files
2.extension
extent a Class with member-vars...and other some
i don't think it is useful
3.SEL
SEL --> a kind of data-type,it is a method's sign
quote:https://blog.csdn.net/gilgamesho/article/details/50590582
3 functions:
①:check if a obj or class has the Method
SEL sel = @selector(test);
flag = [p respondsToSelector:sel];
NSLog(@"flag = %i", flag);
flag = [Class respondsToSelector:sel];
NSLog(@"flag = %i", flag);
②invole a obj/class method
[p performSelector:sel withObject:@"XXXXX"];
SEL sel2 = @selector(setAge:);
[p performSelector:sel withObject:@"XXXXX"];
NSLog(@"age = %i", p.age);
③formal parameter
be a formal parameter
4.block
what is block: it is a data-type
quote:https://blog.csdn.net/aa605397965/article/details/46918093
provisionally don't know the invoking scene
5.protocol
observe a protocol --> obj : NSObject <protocol name1,protocol name2>
@required:
forced to be implemented methods
@optional
not forcedID <protocol> can indicate any obj which has implemented that protocol
Sum:
the teacher is the key,some are just soso.