File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -401,9 +401,9 @@ static void aspect_swizzleForwardInvocation(Class klass) {
401
401
static void aspect_undoSwizzleForwardInvocation (Class klass) {
402
402
NSCParameterAssert (klass);
403
403
Method originalMethod = class_getInstanceMethod (klass, NSSelectorFromString (AspectsForwardInvocationSelectorName));
404
- Method objectMethod = class_getInstanceMethod (NSObject .class , @selector (forwardInvocation: ));
405
- // There is no class_removeMethod, so the best we can do is to retore the original implementation, or use a dummy .
406
- IMP originalImplementation = method_getImplementation (originalMethod ?: objectMethod );
404
+ Method superClassMethod = class_getInstanceMethod (class_getSuperclass (klass) ?: NSObject .class , @selector (forwardInvocation: ));
405
+ // There is no class_removeMethod, so the best we can do is to retore the original implementation, or use superclass's .
406
+ IMP originalImplementation = method_getImplementation (originalMethod ?: superClassMethod );
407
407
class_replaceMethod (klass, @selector (forwardInvocation: ), originalImplementation, " v@:@" );
408
408
409
409
AspectLog (@" Aspects: %@ has been restored." , NSStringFromClass (klass));
You can’t perform that action at this time.
0 commit comments