views:

62

answers:

2

I have an NSString containing the name of a selector I would like to call with performSelector. How can I get a reference to the selector from the string?

+5  A: 

NSSelectorFromString(name)

BJ Homer
That answer was too easy...
TahoeWolverine
Easy like objective-c easy ...?
stefanB
Yet, I was about a min off from being 1st... sigh.
Rev316
+2  A: 

Could use NSSelectorFromString.

Probably inefficient as parameterizing a SEL is preferred.

Rev316