views:

61

answers:

2

Is it possible, given a SEL to generate a string representation of the method it refers to?

For context:

I have an object instance initialized thusly:

-(id) initWithTarget:(id)object action: (SEL)action;

Within the instance I would like to echo the string name of the method referred to by SEL. How do I do that?

+1  A: 

Use sel_getName.

fbrereto
+6  A: 

NSStringFromSelector

Conversion in opposite direction is also possible

NSSelectorFromString

Mihir Mathuria
Lovely. Thanks Mihir.
dugla