ARC下动态调用方法

清醒疯子 发布于 2015年01月22日
无人欣赏。
SEL selector = NSSelectorFromString(methodString);
if ([self respondsToSelector:selector]) {
    //[self performSelector:selector withObject:parameterString];
    IMP imp = [self methodForSelector:selector];
    void (*func)(id, SEL, NSString *) = (void *)imp;
    func(self, selector, URLString);
}
暂无回复
登录 或者 注册
相关帖子