可以很方便的通过NSObject
的+ (NSMethodSignature *)instanceMethodSignatureForSelector:(SEL)aSelector
方法获取NSMethodSignature
,
然后通过NSInvocation
的+ (NSInvocation *)invocationWithMethodSignature:(NSMethodSignature *)signature
生成NSInvocation
这里只能得到instanceMethodSignature
,怎么获取类方法?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
建立一个单例辅助对象,辅助对象的实例方法a调用类方法b,再获得a的MethodSignature