Skip to content

Commit 6358799

Browse files
committed
Merge branch 'dmaclach-objc_forward'
2 parents 06e8a9a + 44207bd commit 6358799

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Source/OCMock/NSObject+OCMAdditions.m

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,15 @@
1414
* under the License.
1515
*/
1616

17+
#import <objc/message.h>
1718
#import <objc/runtime.h>
1819
#import "NSMethodSignature+OCMAdditions.h"
1920
#import "NSObject+OCMAdditions.h"
2021

21-
2222
@implementation NSObject(OCMAdditions)
2323

2424
+ (IMP)instanceMethodForwarderForSelector:(SEL)aSelector
2525
{
26-
// use sel_registerName() and not @selector to avoid warning
27-
SEL selectorWithNoImplementation = sel_registerName("methodWhichMustNotExist::::");
28-
2926
#ifndef __arm64__
3027
static NSMutableDictionary *_OCMReturnTypeCache;
3128

@@ -49,10 +46,10 @@ + (IMP)instanceMethodForwarderForSelector:(SEL)aSelector
4946
}
5047

5148
if(needsStructureReturn)
52-
return class_getMethodImplementation_stret([NSObject class], selectorWithNoImplementation);
49+
return _objc_msgForward_stret;
5350
#endif
5451

55-
return class_getMethodImplementation([NSObject class], selectorWithNoImplementation);
52+
return _objc_msgForward;
5653
}
5754

5855
+ (void)enumerateMethodsInClass:(Class)aClass usingBlock:(void (^)(Class cls, SEL sel))aBlock

0 commit comments

Comments
 (0)