diff --git a/JRSwizzle.m b/JRSwizzle.m index 4e582bf..ef03c48 100644 --- a/JRSwizzle.m +++ b/JRSwizzle.m @@ -89,14 +89,22 @@ + (BOOL)jr_swizzleMethod:(SEL)origSel_ withMethod:(SEL)altSel_ error:(NSError**) if (!directOriginalMethod) { inheritedOriginalMethod = class_getInstanceMethod(self, origSel_); if (!inheritedOriginalMethod) { - SetNSError(error_, @"original method %@ not found for class %@", NSStringFromSelector(origSel_), [self className]); +#if TARGET_OS_IPHONE + SetNSError(error_, @"original method %@ not found for class %@", NSStringFromSelector(origSel_), [self class]); +#else + SetNSError(error_, @"original method %@ not found for class %@", NSStringFromSelector(origSel_), [self className]); +#endif return NO; } } if (!directAlternateMethod) { inheritedAlternateMethod = class_getInstanceMethod(self, altSel_); if (!inheritedAlternateMethod) { - SetNSError(error_, @"alternate method %@ not found for class %@", NSStringFromSelector(altSel_), [self className]); +#if TARGET_OS_IPHONE + SetNSError(error_, @"alternate method %@ not found for class %@", NSStringFromSelector(altSel_), [self class]); +#else + SetNSError(error_, @"alternate method %@ not found for class %@", NSStringFromSelector(altSel_), [self className]); +#endif return NO; } }