diff --git a/Source/OCMock/NSObject+OCMAdditions.m b/Source/OCMock/NSObject+OCMAdditions.m index e116a3db..cf4674ea 100644 --- a/Source/OCMock/NSObject+OCMAdditions.m +++ b/Source/OCMock/NSObject+OCMAdditions.m @@ -14,18 +14,15 @@ * under the License. */ +#import #import #import "NSMethodSignature+OCMAdditions.h" #import "NSObject+OCMAdditions.h" - @implementation NSObject(OCMAdditions) + (IMP)instanceMethodForwarderForSelector:(SEL)aSelector { - // use sel_registerName() and not @selector to avoid warning - SEL selectorWithNoImplementation = sel_registerName("methodWhichMustNotExist::::"); - #ifndef __arm64__ static NSMutableDictionary *_OCMReturnTypeCache; @@ -49,10 +46,10 @@ + (IMP)instanceMethodForwarderForSelector:(SEL)aSelector } if(needsStructureReturn) - return class_getMethodImplementation_stret([NSObject class], selectorWithNoImplementation); + return _objc_msgForward_stret; #endif - return class_getMethodImplementation([NSObject class], selectorWithNoImplementation); + return _objc_msgForward; } + (void)enumerateMethodsInClass:(Class)aClass usingBlock:(void (^)(Class cls, SEL sel))aBlock