Martijn The avatar Martijn The committed 9831b44

Cleanup of SDK dependent stuff

Comments (0)

Files changed (3)

NSURLConnectionVCR.xcodeproj/project.pbxproj

 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
 				GCC_WARN_UNINITIALIZED_AUTOS = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
-				MACOSX_DEPLOYMENT_TARGET = 10.8;
+				MACOSX_DEPLOYMENT_TARGET = "";
 				ONLY_ACTIVE_ARCH = YES;
 				SDKROOT = "";
 			};
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
 				GCC_WARN_UNINITIALIZED_AUTOS = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
-				MACOSX_DEPLOYMENT_TARGET = 10.8;
+				MACOSX_DEPLOYMENT_TARGET = "";
 				SDKROOT = "";
 			};
 			name = Release;
 				INFOPLIST_FILE = "NSURLConnectionVCRQuicklook/NSURLConnectionVCRQuicklook-Info.plist";
 				INSTALL_PATH = /Library/QuickLook;
 				PRODUCT_NAME = "$(TARGET_NAME)";
-				SDKROOT = macosx;
 				WRAPPER_EXTENSION = qlgenerator;
 			};
 			name = Debug;
 				INFOPLIST_FILE = "NSURLConnectionVCRQuicklook/NSURLConnectionVCRQuicklook-Info.plist";
 				INSTALL_PATH = /Library/QuickLook;
 				PRODUCT_NAME = "$(TARGET_NAME)";
-				SDKROOT = macosx;
 				WRAPPER_EXTENSION = qlgenerator;
 			};
 			name = Release;

NSURLConnectionVCR/NSURLConnectionVCR.m

 #import <CommonCrypto/CommonDigest.h>
 #import <objc/runtime.h>
 #import <objc/objc.h>
-#import <CoreServices/CoreServices.h>
 
 NSString* NSURLConnectionVCRErrorDomain = @"NSURLConnectionVCRErrorDomain";
 struct objc_class;
             SEL theSelector;
             origImps = (IMP*)malloc(swizzleCount * sizeof(IMP));
             
-            for (uint8 i = 0; i < swizzleCount; ++i) {
+            for (unsigned char i = 0; i < swizzleCount; ++i) {
                 theSelector = swizzleSelectors[i];
                 origMethod = class_getInstanceMethod(theClass, theSelector);
                 origImps[i] = method_getImplementation(origMethod);
+                
+                // Depending on your SDK, you might need a bridged cast here:
+                // poseImplementation = imp_implementationWithBlock((__bridge void*)poseImplementationBlockForSelector(theSelector));
                 poseImplementation = imp_implementationWithBlock(poseImplementationBlockForSelector(theSelector));
+                
                 class_replaceMethod(theClass, theSelector, poseImplementation, method_getTypeEncoding(origMethod));
             }
             return YES;
         Class theClass = objc_getMetaClass("NSURLConnection");
         IMP previousImp;
 
-        for (uint8 i = 0; i < swizzleCount; ++i) {
+        for (unsigned char i = 0; i < swizzleCount; ++i) {
             theSelector = swizzleSelectors[i];
             theMethod = class_getInstanceMethod(theClass, theSelector);
             previousImp = class_replaceMethod(theClass, theSelector, origImps[i], method_getTypeEncoding(theMethod));
 
 #pragma mark Class posing / Swizzle bizz
 
-static const uint8 swizzleCount = 3;
+static const unsigned char swizzleCount = 3;
 static SEL swizzleSelectors[swizzleCount] = {NULL, NULL, NULL};
 
 + (void)initialize {
 
 @end
 
+@protocol NSURLConnectionDataDelegate;
+@protocol NSURLConnectionDownloadDelegate;
 
 @implementation VCRConnectionDelegate {
-    __strong NSObject<NSURLConnectionDelegate, NSURLConnectionDataDelegate, NSURLConnectionDownloadDelegate, NSObject>* realDelegate;
+    // Depending on your SDK, you might need one of these 2 lines:
+    //__strong NSObject<NSURLConnectionDelegate, NSObject>* realDelegate;    
+    __strong NSObject<NSURLConnectionDelegate, NSURLConnectionDataDelegate, NSURLConnectionDownloadDelegate, NSObject>* realDelegate;    
     NSURLConnectionVCR* vcr;
     NSURLRequest* request;
     NSURLResponse* response;
Add a comment to this file

NSURLConnectionVCRTests/VCRTapes/3BE7EE88992C73C5A003BE0E36AC1F14.vcr

Binary file modified.

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.