2020年1月4日 Ledemon iOS,OC, 0 comments iOS OC Runtime动态调用方法 调用无参方法 Class class = NSClassFromString(@"classA"); SEL selector = NSSelectorFromString(@"方法名"); IMP imp = [class methodForSelector:selector]; void (*func)(id, SEL) = (void *)imp; func(class, selector); 123456 Class class = NSClassFromString(@"classA");SEL selector = NSSelectorFromString(@"方法名");IMP imp = [class methodForSelector:selector];void (*func)(id, SEL) = (void *)imp;func(class, selector); 有参有返回值方法 [crayo Read More