Any idea why such error when Apple Silicon enabled?
Too many arguments to function call, expected 0, have 3
The error is on line NSMethodSignature *ret = instanceMethodForSelectorIMP( self->targetObjectClass, @selector(instanceMethodSignatureForSelector:), aSelector );
Too many arguments to function call, expected 0, have 3
The error is on line NSMethodSignature *ret = instanceMethodForSelectorIMP( self->targetObjectClass, @selector(instanceMethodSignatureForSelector:), aSelector );
Code Block - (NSMethodSignature *)methodSignatureForSelector: (SEL)aSelector { //DEBUGLOG( @"" ); id obj = [ self resolveTargetObject ]; if( obj == nil ){ Method instanceMethod = class_getClassMethod( self->targetObjectClass, @selector(instanceMethodSignatureForSelector:) ); IMP instanceMethodForSelectorIMP = method_getImplementation( instanceMethod ); NSMethodSignature *ret = instanceMethodForSelectorIMP( self->targetObjectClass, @selector(instanceMethodSignatureForSelector:), aSelector ); return ret; } return [ obj methodSignatureForSelector: aSelector ]; }
On the line, you are passing 3 arguments, Class, SEL, SEL. You need to tell it to the compiler.The error is on line NSMethodSignature *ret = instanceMethodForSelectorIMP( self->targetObjectClass, @selector(instanceMethodSignatureForSelector:), aSelector );
Try changing the definition of instanceMethodForSelectorIMP:
Code Block id (*instanceMethodForSelectorIMP)(Class, SEL, SEL) = (id(*)(Class,SEL,SEL))method_getImplementation( instanceMethod );