Cocoa问题:如何获得SEL的字符串表示?

dug*_*gla 4 cocoa introspection css-selectors

是否有可能,给定a SEL生成它所引用的方法的字符串表示?

对于上下文:

我有一个对象实例初始化:

-(id) initWithTarget:(id)object action: (SEL)action;
Run Code Online (Sandbox Code Playgroud)

在实例中,我想回显引用的方法的字符串名称SEL.我怎么做?

Mih*_*ria 8

NSStringFromSelector

也可以在相反方向上进行转换

NSSelectorFromString