Permalink
Browse files

Merge pull request #14 from jwilling/master

Fix a small bridging error due to changed signature for `imp_implementationWithBlock` in 10.8/iOS6 SDKs.
  • Loading branch information...
2 parents b9b64d1 + e83c735 commit d464913d83c1031dc1e108c6a8e25da6e24b18d0 @mikeash committed Jun 17, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 MAKVONotificationCenter.m
@@ -323,7 +323,12 @@ - (void)_swizzleObjectClassIfNeeded:(id)object
SEL deallocSel = NSSelectorFromString(@"dealloc");/*@selector(dealloc)*/
Method dealloc = class_getInstanceMethod(class, deallocSel);
IMP origImpl = method_getImplementation(dealloc),
+ #if __IPHONE_OS_VERSION_MAX_ALLOWED < __IPHONE_6_0 || __MAC_OS_X_VERSION_MAX_ALLOWED < __MAC_10_8
+ newImpl = imp_implementationWithBlock(^ (void *obj)
+ #else
newImpl = imp_implementationWithBlock((__bridge void *)^ (void *obj)
+ #endif
+
{
//NSLog(@"Auto-deregistering any helpers (%@) on object %@ of class %@", objc_getAssociatedObject((__bridge id)obj, &MAKVONotificationCenter_HelpersKey), obj, class);
@autoreleasepool

0 comments on commit d464913

Please sign in to comment.