[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];

}

posted @ 2013-03-22 11:14  金建彤  阅读(798)  评论(0编辑  收藏  举报