[ios] 函数与字符串的相互转化,@selecte函数转化为字符串传递,字符串转化为@select接收 【转】
来至:http://blog.csdn.net/liuyuyefz/article/details/7899718
@selecte函数转化为字符串传递
-(void)passFun
{
[Class recieveFun:NSStringFromSelector(@selector(fun))];
}
字符串转化为@select接收
-(void)recieveFun:(NSString)funString
{
SEL selector = NSSelectorFromString(funString);
[self.performFunTarget performSelector:selector withObject:sender];
}