可以很方便的通过NSObject
的+ (NSMethodSignature *)instanceMethodSignatureForSelector:(SEL)aSelector
方法获取NSMethodSignature
,
然后通过NSInvocation
的+ (NSInvocation *)invocationWithMethodSignature:(NSMethodSignature *)signature
生成NSInvocation
这里只能得到instanceMethodSignature
,怎么获取类方法?
Create a singleton auxiliary object. The instance method a of the auxiliary object calls the class method b, and then obtains the MethodSignature of a