【iOS】@selector

1、selector可以理解为函数指针。

2、@selector(xxxx)找到名字为xxxx的方法,返回类型为SEL。

3、SEL定义:

typedef struct objc_selector *SEL;

SEL在mac os 中被映射成一个C字符串,可以看做是方法的名字,但不指向方法的实现,IMP才指向方法的实现。

@selector = SEL = NSSelectorFromString(@"method:");

你可能感兴趣的:(【iOS】@selector)