一.iOS中_cmd The _cmd variable is a hidden argument passed to every method that is the current selector 源码: - (void)tryMessage { SEL currentSel = _cmd; // 通过_cmd关键字取到当前函数对应的SEL NSLog(@"currentSel is :%s",sel_getName(currentSel)); // C代码结果 NSLog(@&…
Runtime中Method详细介绍 1.找到它,认识它 //*> 在objc/runtime.h中定义了Method类型,Method是一个objc_method结构体指针,结构体中包含SEL.IMP这两种类型,下面做介绍 /// An opaque type that represents a method in a class definition. typedef struct objc_method *Method; struct objc_method { SEL method_na…