通过方法名(字符串)执行Objective-C方法

     SEL selector = NSSelectorFromString(@"方法名");  
     if ([self respondsToSelector:selector]){ //判断是否存在这个方法
             IMP imp = [self methodForSelector:selector];
             imp();
     }

常用于 web与objective-c方法交互

原文地址:https://www.cnblogs.com/n1ckyxu/p/5201192.html