问题
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?
回答1:
NSSelectorFromString(name)
回答2:
Could use NSSelectorFromString.
Probably inefficient as parameterizing a SEL is preferred.
来源:https://stackoverflow.com/questions/1174985/how-do-i-get-a-selector-from-its-name