diff --git a/Source/OCMock/OCClassMockObject.m b/Source/OCMock/OCClassMockObject.m index 96a11001..088d2e26 100644 --- a/Source/OCMock/OCClassMockObject.m +++ b/Source/OCMock/OCClassMockObject.m @@ -116,7 +116,7 @@ - (void)setupForwarderForClassMethodSelector:(SEL)selector IMP originalIMP = method_getImplementation(method); [replacedClassMethods setObject:[NSValue valueWithPointer:originalIMP] forKey:NSStringFromSelector(selector)]; - Class metaClass = objc_getMetaClass(class_getName(mockedClass)); + Class metaClass = object_getClass(mockedClass); IMP forwarderIMP = [NSMethodSignature forwarderForClass:mockedClass selector:selector]; class_replaceMethod(metaClass, method_getName(method), forwarderIMP, method_getTypeEncoding(method)); }