首页 > 代码库 > iOS根据类名执行函数

iOS根据类名执行函数

iOS根据类名执行函数

by 伍雪颖

SEL dynamicSelector = NSSelectorFromString([NSString stringWithFormat:@"pushTo%@Page", type]);
if(![self respondsToSelector:dynamicSelector]) {
    return;
}
[self performSelector:dynamicSelector withObject:nil];

iOS根据类名执行函数