Commits

Anders Carlsson committed 15de133

No need to do a bridged cast in iOS SDK 6.

  • Participants
  • Parent commits c33f2eb

Comments (0)

Files changed (1)

NSURLConnectionVCR/NSURLConnectionVCR.m

 #import <objc/runtime.h>
 #import <objc/objc.h>
 
+#ifdef __IPHONE_6_0
+#define CAST_TO_BLOCK id
+#else
+#define CAST_TO_BLOCK __bridge void *
+#endif
+
 NSString* NSURLConnectionVCRErrorDomain = @"NSURLConnectionVCRErrorDomain";
 struct objc_class;
 __strong static NSString* casettesPath;
                 theSelector = swizzleSelectors[i];
                 origMethod = class_getInstanceMethod(theClass, theSelector);
                 origImps[i] = method_getImplementation(origMethod);
-                
+
                 // Depending on your SDK, you might need a bridged cast here:
 #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE
-                poseImplementation = imp_implementationWithBlock((__bridge void*)poseImplementationBlockForSelector(theSelector));
+                poseImplementation = imp_implementationWithBlock((CAST_TO_BLOCK)poseImplementationBlockForSelector(theSelector));
 #else
                 poseImplementation = imp_implementationWithBlock(poseImplementationBlockForSelector(theSelector));
 #endif