//block -> imp
IMP blockIMP = imp_implementationWithBlock(block);
//object,sel -> imp
IMP imp = [object methodForSelector:sel]
//class,sel -> imp
IMP imp = [class instanceMethodForSelector:sel]
//object,sel -> Method
Method method = class_getInstanceMethod(object, sel);
//NSString -> sel
SEL sel = NSSelectorFromString(@"sharedInstance");
//SEL -> NSString
NSString *str = NSStringFromSelector(sel);
//target,sel -> signature
NSMethodSignature *signature = [target methodSignatureForSelector:sel];
//signature -> invocation
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
[invocation setArgument:&arg1 atIndex:2];
[invocation setArgument:&arg2 atIndex:3];
[invocation setArgument:&arg3 atIndex:4];
invocation.target = target
invocation.selector = sel
[invocation invoke];
const char *value;//不同的类型,不同的接收方式
[invocation getReturnValue:&value];
return value;
执行一个imp
TartetObject *target = [TartetObject new];
SEL sel = NSSelectorFromString(@"callFun1");
Method m = class_getInstanceMethod([target class], sel);
IMP imp = method_getImplementation(m);
imp(target,sel);