NSInvocation 可以方便的调用
NSMethodSignature *signature = [target.class instanceMethodSignatureForSelector:sel];
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
[invocation setArgument:&userInfo atIndex:2];
[invocation setSelector:sel];
BOOL result = NO;
[invocation invokeWithTarget:self.global];
[invocation getReturnValue:&result];
网友评论