我正在努力通过Facade类转发类方法.
为了澄清,我推翻了以下所有方法:
-(NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector
-(void)forwardInvocation:(NSInvocation *)anInvocation
+(BOOL)instancesRespondToSelector:(SEL)aSelector
+(NSMethodSignature *)instanceMethodSignatureForSelector:(SEL)aSelector
+(IMP)instanceMethodForSelector:(SEL)aSelector
+(BOOL)resolveClassMethod:(SEL)sel
+(BOOL)resolveInstanceMethod:(SEL)sel
Run Code Online (Sandbox Code Playgroud)
..然而,对于类方法,唯一要调用的是+resolveClassMethod.从那里,无论我是否返回YES,我都会立即得到一个无法识别的选择器异常.
这是怎么回事?
类消息转发与实例消息转发的工作方式不同吗?
同样,为什么没有+forwardInvocation类方法呢?
任何帮助将不胜感激.