├── JRSwizzle.h ├── JRSwizzle.m ├── JRSwizzle.podspec ├── JRSwizzleTest ├── 10.3 Test-Info.plist ├── 10.4 Test-Info.plist ├── 10.5 32-bit Test-Info.plist ├── 10.5 64-bit Test-Info.plist ├── AppleSwizzleTest.h ├── AppleSwizzleTest.m ├── BallardSwizzleTest.h ├── BallardSwizzleTest.m ├── ClassicSwizzleTest.h ├── ClassicSwizzleTest.m ├── JRSwizzleTest.h ├── JRSwizzleTest.m ├── JRSwizzleTest.xcodeproj │ └── project.pbxproj ├── JRSwizzleTest_Prefix.pch ├── MethodSwizzle.h ├── MethodSwizzle.m └── main.m ├── LICENSE └── README.markdown /JRSwizzle.h: -------------------------------------------------------------------------------- 1 | // JRSwizzle.h semver:1.1.0 2 | // Copyright (c) 2007-2016 Jonathan 'Wolf' Rentzsch: http://rentzsch.com 3 | // Some rights reserved: http://opensource.org/licenses/mit 4 | // https://github.com/rentzsch/jrswizzle 5 | 6 | #import 7 | 8 | @interface NSObject (JRSwizzle) 9 | 10 | + (BOOL)jr_swizzleMethod:(SEL)origSel_ withMethod:(SEL)altSel_ error:(NSError**)error_; 11 | + (BOOL)jr_swizzleClassMethod:(SEL)origSel_ withClassMethod:(SEL)altSel_ error:(NSError**)error_; 12 | 13 | 14 | /** 15 | ``` 16 | __block NSInvocation *invocation = nil; 17 | invocation = [self jr_swizzleMethod:@selector(initWithCoder:) withBlock:^(id obj, NSCoder *coder) { 18 | NSLog(@"before %@, coder %@", obj, coder); 19 | 20 | [invocation setArgument:&coder atIndex:2]; 21 | [invocation invokeWithTarget:obj]; 22 | 23 | id ret = nil; 24 | [invocation getReturnValue:&ret]; 25 | 26 | NSLog(@"after %@, coder %@", obj, coder); 27 | 28 | return ret; 29 | } error:nil]; 30 | ``` 31 | */ 32 | + (NSInvocation*)jr_swizzleMethod:(SEL)origSel withBlock:(id)block error:(NSError**)error; 33 | 34 | /** 35 | ``` 36 | __block NSInvocation *classInvocation = nil; 37 | classInvocation = [self jr_swizzleClassMethod:@selector(test) withBlock:^() { 38 | NSLog(@"before"); 39 | 40 | [classInvocation invoke]; 41 | 42 | NSLog(@"after"); 43 | } error:nil]; 44 | ``` 45 | */ 46 | + (NSInvocation*)jr_swizzleClassMethod:(SEL)origSel withBlock:(id)block error:(NSError**)error; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /JRSwizzle.m: -------------------------------------------------------------------------------- 1 | // JRSwizzle.m semver:1.1.0 2 | // Copyright (c) 2007-2016 Jonathan 'Wolf' Rentzsch: http://rentzsch.com 3 | // Some rights reserved: http://opensource.org/licenses/mit 4 | // https://github.com/rentzsch/jrswizzle 5 | 6 | #import "JRSwizzle.h" 7 | 8 | #if TARGET_OS_IPHONE 9 | #import 10 | #import 11 | #else 12 | #import 13 | #endif 14 | 15 | #define SetNSErrorFor(FUNC, ERROR_VAR, FORMAT,...) \ 16 | if (ERROR_VAR) { \ 17 | NSString *errStr = [NSString stringWithFormat:@"%s: " FORMAT,FUNC,##__VA_ARGS__]; \ 18 | *ERROR_VAR = [NSError errorWithDomain:@"NSCocoaErrorDomain" \ 19 | code:-1 \ 20 | userInfo:[NSDictionary dictionaryWithObject:errStr forKey:NSLocalizedDescriptionKey]]; \ 21 | } 22 | #define SetNSError(ERROR_VAR, FORMAT,...) SetNSErrorFor(__func__, ERROR_VAR, FORMAT, ##__VA_ARGS__) 23 | 24 | #if OBJC_API_VERSION >= 2 25 | #define GetClass(obj) object_getClass(obj) 26 | #else 27 | #define GetClass(obj) (obj ? obj->isa : Nil) 28 | #endif 29 | 30 | @implementation NSObject (JRSwizzle) 31 | 32 | + (BOOL)jr_swizzleMethod:(SEL)origSel_ withMethod:(SEL)altSel_ error:(NSError**)error_ { 33 | #if OBJC_API_VERSION >= 2 34 | Method origMethod = class_getInstanceMethod(self, origSel_); 35 | if (!origMethod) { 36 | #if TARGET_OS_IPHONE 37 | SetNSError(error_, @"original method %@ not found for class %@", NSStringFromSelector(origSel_), [self class]); 38 | #else 39 | SetNSError(error_, @"original method %@ not found for class %@", NSStringFromSelector(origSel_), [self className]); 40 | #endif 41 | return NO; 42 | } 43 | 44 | Method altMethod = class_getInstanceMethod(self, altSel_); 45 | if (!altMethod) { 46 | #if TARGET_OS_IPHONE 47 | SetNSError(error_, @"alternate method %@ not found for class %@", NSStringFromSelector(altSel_), [self class]); 48 | #else 49 | SetNSError(error_, @"alternate method %@ not found for class %@", NSStringFromSelector(altSel_), [self className]); 50 | #endif 51 | return NO; 52 | } 53 | 54 | class_addMethod(self, 55 | origSel_, 56 | class_getMethodImplementation(self, origSel_), 57 | method_getTypeEncoding(origMethod)); 58 | class_addMethod(self, 59 | altSel_, 60 | class_getMethodImplementation(self, altSel_), 61 | method_getTypeEncoding(altMethod)); 62 | 63 | method_exchangeImplementations(class_getInstanceMethod(self, origSel_), class_getInstanceMethod(self, altSel_)); 64 | return YES; 65 | #else 66 | // Scan for non-inherited methods. 67 | Method directOriginalMethod = NULL, directAlternateMethod = NULL; 68 | 69 | void *iterator = NULL; 70 | struct objc_method_list *mlist = class_nextMethodList(self, &iterator); 71 | while (mlist) { 72 | int method_index = 0; 73 | for (; method_index < mlist->method_count; method_index++) { 74 | if (mlist->method_list[method_index].method_name == origSel_) { 75 | assert(!directOriginalMethod); 76 | directOriginalMethod = &mlist->method_list[method_index]; 77 | } 78 | if (mlist->method_list[method_index].method_name == altSel_) { 79 | assert(!directAlternateMethod); 80 | directAlternateMethod = &mlist->method_list[method_index]; 81 | } 82 | } 83 | mlist = class_nextMethodList(self, &iterator); 84 | } 85 | 86 | // If either method is inherited, copy it up to the target class to make it non-inherited. 87 | if (!directOriginalMethod || !directAlternateMethod) { 88 | Method inheritedOriginalMethod = NULL, inheritedAlternateMethod = NULL; 89 | if (!directOriginalMethod) { 90 | inheritedOriginalMethod = class_getInstanceMethod(self, origSel_); 91 | if (!inheritedOriginalMethod) { 92 | #if TARGET_OS_IPHONE 93 | SetNSError(error_, @"original method %@ not found for class %@", NSStringFromSelector(origSel_), [self class]); 94 | #else 95 | SetNSError(error_, @"original method %@ not found for class %@", NSStringFromSelector(origSel_), [self className]); 96 | #endif 97 | return NO; 98 | } 99 | } 100 | if (!directAlternateMethod) { 101 | inheritedAlternateMethod = class_getInstanceMethod(self, altSel_); 102 | if (!inheritedAlternateMethod) { 103 | #if TARGET_OS_IPHONE 104 | SetNSError(error_, @"alternate method %@ not found for class %@", NSStringFromSelector(altSel_), [self class]); 105 | #else 106 | SetNSError(error_, @"alternate method %@ not found for class %@", NSStringFromSelector(altSel_), [self className]); 107 | #endif 108 | return NO; 109 | } 110 | } 111 | 112 | int hoisted_method_count = !directOriginalMethod && !directAlternateMethod ? 2 : 1; 113 | struct objc_method_list *hoisted_method_list = malloc(sizeof(struct objc_method_list) + (sizeof(struct objc_method)*(hoisted_method_count-1))); 114 | hoisted_method_list->obsolete = NULL; // soothe valgrind - apparently ObjC runtime accesses this value and it shows as uninitialized in valgrind 115 | hoisted_method_list->method_count = hoisted_method_count; 116 | Method hoisted_method = hoisted_method_list->method_list; 117 | 118 | if (!directOriginalMethod) { 119 | bcopy(inheritedOriginalMethod, hoisted_method, sizeof(struct objc_method)); 120 | directOriginalMethod = hoisted_method++; 121 | } 122 | if (!directAlternateMethod) { 123 | bcopy(inheritedAlternateMethod, hoisted_method, sizeof(struct objc_method)); 124 | directAlternateMethod = hoisted_method; 125 | } 126 | class_addMethods(self, hoisted_method_list); 127 | } 128 | 129 | // Swizzle. 130 | IMP temp = directOriginalMethod->method_imp; 131 | directOriginalMethod->method_imp = directAlternateMethod->method_imp; 132 | directAlternateMethod->method_imp = temp; 133 | 134 | return YES; 135 | #endif 136 | } 137 | 138 | + (BOOL)jr_swizzleClassMethod:(SEL)origSel_ withClassMethod:(SEL)altSel_ error:(NSError**)error_ { 139 | return [GetClass((id)self) jr_swizzleMethod:origSel_ withMethod:altSel_ error:error_]; 140 | } 141 | 142 | + (NSInvocation*)jr_swizzleMethod:(SEL)origSel withBlock:(id)block error:(NSError**)error { 143 | IMP blockIMP = imp_implementationWithBlock(block); 144 | NSString *blockSelectorString = [NSString stringWithFormat:@"_jr_block_%@_%p", NSStringFromSelector(origSel), block]; 145 | SEL blockSel = sel_registerName([blockSelectorString cStringUsingEncoding:NSUTF8StringEncoding]); 146 | Method origSelMethod = class_getInstanceMethod(self, origSel); 147 | const char* origSelMethodArgs = method_getTypeEncoding(origSelMethod); 148 | class_addMethod(self, blockSel, blockIMP, origSelMethodArgs); 149 | 150 | NSMethodSignature *origSig = [NSMethodSignature signatureWithObjCTypes:origSelMethodArgs]; 151 | NSInvocation *origInvocation = [NSInvocation invocationWithMethodSignature:origSig]; 152 | origInvocation.selector = blockSel; 153 | 154 | [self jr_swizzleMethod:origSel withMethod:blockSel error:nil]; 155 | 156 | return origInvocation; 157 | } 158 | 159 | + (NSInvocation*)jr_swizzleClassMethod:(SEL)origSel withBlock:(id)block error:(NSError**)error { 160 | NSInvocation *invocation = [GetClass((id)self) jr_swizzleMethod:origSel withBlock:block error:error]; 161 | invocation.target = self; 162 | 163 | return invocation; 164 | } 165 | 166 | @end 167 | -------------------------------------------------------------------------------- /JRSwizzle.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'JRSwizzle' 3 | s.version = '1.1.0' 4 | s.license = 'MIT' 5 | s.summary = 'one-stop-shop for all your method swizzling needs' 6 | s.homepage = 'https://github.com/rentzsch/jrswizzle' 7 | s.author = 'Jonathan \'Wolf\' Rentzsch' 8 | s.source = { :git => 'https://github.com/rentzsch/jrswizzle.git', :tag => "v#{s.version}" } 9 | s.requires_arc = false 10 | 11 | s.description = %{ 12 | JRSwizzle is source code package that offers a single, easy, correct+consistent interface for exchanging Objective-C method implementations ("method swizzling") across many versions of Mac OS X, iOS, Objective-C and runtime architectures. 13 | 14 | More succinctly: JRSwizzle wants to be your one-stop-shop for all your method swizzling needs. 15 | } 16 | 17 | s.source_files = '*.{h,m}' 18 | 19 | s.ios.deployment_target = '4.3' 20 | s.osx.deployment_target = '10.6' 21 | 22 | s.frameworks = 'Foundation' 23 | end 24 | -------------------------------------------------------------------------------- /JRSwizzleTest/10.3 Test-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.yourcompany.10.3 Test 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | 20 | 21 | -------------------------------------------------------------------------------- /JRSwizzleTest/10.4 Test-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.yourcompany.10.4 Test 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | 20 | 21 | -------------------------------------------------------------------------------- /JRSwizzleTest/10.5 32-bit Test-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.yourcompany.10.5 32-bit Test 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | 20 | 21 | -------------------------------------------------------------------------------- /JRSwizzleTest/10.5 64-bit Test-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.yourcompany.10.5 64-bit Test 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | 20 | 21 | -------------------------------------------------------------------------------- /JRSwizzleTest/AppleSwizzleTest.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface AppleSwizzleTest : SenTestCase { 4 | 5 | } 6 | 7 | - (void)testAppleSwizzleOfDirectMethod; 8 | - (void)testAppleSwizzleOfInheritedMethod; 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /JRSwizzleTest/AppleSwizzleTest.m: -------------------------------------------------------------------------------- 1 | #import "AppleSwizzleTest.h" 2 | #import 3 | 4 | BOOL aFooCalled, bFooCalled, bAltFooCalled; 5 | 6 | @interface A5 : NSObject {} 7 | - (void)foo5; 8 | @end 9 | @implementation A5 10 | - (void)foo5 { 11 | aFooCalled = YES; 12 | } 13 | @end 14 | 15 | @interface B5 : A5 {} 16 | @end 17 | @implementation B5 18 | - (void)foo5 { 19 | bFooCalled = YES; 20 | } 21 | @end 22 | 23 | @interface B5 (altFoo5) 24 | - (void)altFoo5; 25 | @end 26 | @implementation B5 (altFoo5) 27 | - (void)altFoo5 { 28 | bAltFooCalled = YES; 29 | } 30 | @end 31 | 32 | @interface A6 : NSObject {} 33 | - (void)foo6; 34 | @end 35 | @implementation A6 36 | - (void)foo6 { 37 | aFooCalled = YES; 38 | } 39 | @end 40 | 41 | @interface B6 : A6 {} 42 | @end 43 | @implementation B6 44 | @end 45 | 46 | @interface B6 (altFoo6) 47 | - (void)altFoo6; 48 | @end 49 | @implementation B6 (altFoo6) 50 | - (void)altFoo6 { 51 | bAltFooCalled = YES; 52 | } 53 | @end 54 | 55 | @implementation AppleSwizzleTest 56 | 57 | - (void)testAppleSwizzleOfDirectMethod { 58 | A5 *a = [[[A5 alloc] init] autorelease]; 59 | B5 *b = [[[B5 alloc] init] autorelease]; 60 | 61 | { 62 | aFooCalled = bFooCalled = bAltFooCalled = NO; 63 | [a foo5]; 64 | STAssertTrue(aFooCalled, nil); 65 | STAssertFalse(bFooCalled, nil); 66 | STAssertFalse(bAltFooCalled, nil); 67 | 68 | aFooCalled = bFooCalled = bAltFooCalled = NO; 69 | [b foo5]; 70 | STAssertFalse(aFooCalled, nil); 71 | STAssertTrue(bFooCalled, nil); 72 | STAssertFalse(bAltFooCalled, nil); 73 | } 74 | 75 | method_exchangeImplementations(class_getInstanceMethod([B5 class], @selector(foo5)), 76 | class_getInstanceMethod([B5 class], @selector(altFoo5))); 77 | 78 | { 79 | aFooCalled = bFooCalled = bAltFooCalled = NO; 80 | [a foo5]; 81 | STAssertTrue(aFooCalled, nil); 82 | STAssertFalse(bFooCalled, nil); 83 | STAssertFalse(bAltFooCalled, nil); 84 | 85 | aFooCalled = bFooCalled = bAltFooCalled = NO; 86 | [b foo5]; 87 | STAssertFalse(aFooCalled, nil); 88 | STAssertFalse(bFooCalled, nil); 89 | STAssertTrue(bAltFooCalled, nil); 90 | } 91 | } 92 | 93 | - (void)testAppleSwizzleOfInheritedMethod { 94 | A6 *a = [[[A6 alloc] init] autorelease]; 95 | B6 *b = [[[B6 alloc] init] autorelease]; 96 | 97 | { 98 | aFooCalled = bFooCalled = bAltFooCalled = NO; 99 | [a foo6]; 100 | STAssertTrue(aFooCalled, nil); 101 | STAssertFalse(bFooCalled, nil); 102 | STAssertFalse(bAltFooCalled, nil); 103 | 104 | aFooCalled = bFooCalled = bAltFooCalled = NO; 105 | [b foo6]; 106 | STAssertTrue(aFooCalled, nil); 107 | STAssertFalse(bFooCalled, nil); 108 | STAssertFalse(bAltFooCalled, nil); 109 | } 110 | 111 | method_exchangeImplementations(class_getInstanceMethod([B6 class], @selector(foo6)), 112 | class_getInstanceMethod([B6 class], @selector(altFoo6))); 113 | 114 | { 115 | aFooCalled = bFooCalled = bAltFooCalled = NO; 116 | [a foo6]; 117 | STAssertFalse(aFooCalled, nil); // KNOWN INCORRECT BEHAVIOR: [a foo6] resulted in calling B6(altFoo6)'s -altFoo6! 118 | STAssertFalse(bFooCalled, nil); 119 | STAssertTrue(bAltFooCalled, nil); 120 | 121 | aFooCalled = bFooCalled = bAltFooCalled = NO; 122 | [b foo6]; 123 | STAssertFalse(aFooCalled, nil); 124 | STAssertFalse(bFooCalled, nil); 125 | STAssertTrue(bAltFooCalled, nil); 126 | } 127 | } 128 | 129 | @end 130 | -------------------------------------------------------------------------------- /JRSwizzleTest/BallardSwizzleTest.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface BallardSwizzleTest : SenTestCase { 4 | 5 | } 6 | 7 | - (void)testBallardSwizzleOfDirectMethod; 8 | - (void)testBallardSwizzleOfInheritedMethod; 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /JRSwizzleTest/BallardSwizzleTest.m: -------------------------------------------------------------------------------- 1 | #import "BallardSwizzleTest.h" 2 | #import "MethodSwizzle.h" 3 | 4 | BOOL aFooCalled, bFooCalled, bAltFooCalled; 5 | 6 | @interface A3 : NSObject {} 7 | - (void)foo3; 8 | @end 9 | @implementation A3 10 | - (void)foo3 { 11 | aFooCalled = YES; 12 | } 13 | @end 14 | 15 | @interface B3 : A3 {} 16 | @end 17 | @implementation B3 18 | - (void)foo3 { 19 | bFooCalled = YES; 20 | } 21 | @end 22 | 23 | @interface B3 (altFoo3) 24 | - (void)altFoo3; 25 | @end 26 | @implementation B3 (altFoo3) 27 | - (void)altFoo3 { 28 | bAltFooCalled = YES; 29 | } 30 | @end 31 | 32 | @interface A4 : NSObject {} 33 | - (void)foo4; 34 | @end 35 | @implementation A4 36 | - (void)foo4 { 37 | aFooCalled = YES; 38 | } 39 | @end 40 | 41 | @interface B4 : A4 {} 42 | @end 43 | @implementation B4 44 | @end 45 | 46 | @interface B4 (altFoo4) 47 | - (void)altFoo4; 48 | @end 49 | @implementation B4 (altFoo4) 50 | - (void)altFoo4 { 51 | bAltFooCalled = YES; 52 | } 53 | @end 54 | 55 | @implementation BallardSwizzleTest 56 | 57 | - (void)testBallardSwizzleOfDirectMethod { 58 | A3 *a = [[[A3 alloc] init] autorelease]; 59 | B3 *b = [[[B3 alloc] init] autorelease]; 60 | 61 | { 62 | aFooCalled = bFooCalled = bAltFooCalled = NO; 63 | [a foo3]; 64 | STAssertTrue(aFooCalled, nil); 65 | STAssertFalse(bFooCalled, nil); 66 | STAssertFalse(bAltFooCalled, nil); 67 | 68 | aFooCalled = bFooCalled = bAltFooCalled = NO; 69 | [b foo3]; 70 | STAssertFalse(aFooCalled, nil); 71 | STAssertTrue(bFooCalled, nil); 72 | STAssertFalse(bAltFooCalled, nil); 73 | } 74 | 75 | MethodSwizzle([B3 class], @selector(foo3), @selector(altFoo3)); 76 | 77 | { 78 | aFooCalled = bFooCalled = bAltFooCalled = NO; 79 | [a foo3]; 80 | STAssertTrue(aFooCalled, nil); 81 | STAssertFalse(bFooCalled, nil); 82 | STAssertFalse(bAltFooCalled, nil); 83 | 84 | aFooCalled = bFooCalled = bAltFooCalled = NO; 85 | [b foo3]; 86 | STAssertFalse(aFooCalled, nil); 87 | STAssertFalse(bFooCalled, nil); 88 | STAssertTrue(bAltFooCalled, nil); 89 | } 90 | } 91 | 92 | - (void)testBallardSwizzleOfInheritedMethod { 93 | A4 *a = [[[A4 alloc] init] autorelease]; 94 | B4 *b = [[[B4 alloc] init] autorelease]; 95 | 96 | { 97 | aFooCalled = bFooCalled = bAltFooCalled = NO; 98 | [a foo4]; 99 | STAssertTrue(aFooCalled, nil); 100 | STAssertFalse(bFooCalled, nil); 101 | STAssertFalse(bAltFooCalled, nil); 102 | 103 | aFooCalled = bFooCalled = bAltFooCalled = NO; 104 | [b foo4]; 105 | STAssertTrue(aFooCalled, nil); 106 | STAssertFalse(bFooCalled, nil); 107 | STAssertFalse(bAltFooCalled, nil); 108 | } 109 | 110 | MethodSwizzle([B4 class], @selector(foo4), @selector(altFoo4)); 111 | 112 | { 113 | aFooCalled = bFooCalled = bAltFooCalled = NO; 114 | [a foo4]; 115 | STAssertTrue(aFooCalled, nil); // CORRECT BEHAVIOR 116 | STAssertFalse(bFooCalled, nil); 117 | STAssertFalse(bAltFooCalled, nil); 118 | 119 | aFooCalled = bFooCalled = bAltFooCalled = NO; 120 | [b foo4]; 121 | STAssertFalse(aFooCalled, nil); 122 | STAssertFalse(bFooCalled, nil); 123 | STAssertTrue(bAltFooCalled, nil); 124 | } 125 | } 126 | 127 | @end 128 | -------------------------------------------------------------------------------- /JRSwizzleTest/ClassicSwizzleTest.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface ClassicSwizzleTest : SenTestCase { 4 | 5 | } 6 | 7 | - (void)testClassicSwizzleOfDirectMethod; 8 | - (void)testClassicSwizzleOfInheritedMethod; 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /JRSwizzleTest/ClassicSwizzleTest.m: -------------------------------------------------------------------------------- 1 | #import "ClassicSwizzleTest.h" 2 | #import 3 | 4 | // Lifted from http://www.cocoadev.com/index.pl?MethodSwizzling 5 | void ClassicMethodSwizzle(Class aClass, SEL orig_sel, SEL alt_sel) { 6 | Method orig_method = nil, alt_method = nil; 7 | 8 | // First, look for the methods 9 | orig_method = class_getInstanceMethod(aClass, orig_sel); 10 | alt_method = class_getInstanceMethod(aClass, alt_sel); 11 | 12 | // If both are found, swizzle them 13 | if ((orig_method != nil) && (alt_method != nil)) 14 | { 15 | char *temp1; 16 | IMP temp2; 17 | 18 | temp1 = orig_method->method_types; 19 | orig_method->method_types = alt_method->method_types; 20 | alt_method->method_types = temp1; 21 | 22 | temp2 = orig_method->method_imp; 23 | orig_method->method_imp = alt_method->method_imp; 24 | alt_method->method_imp = temp2; 25 | } 26 | } 27 | 28 | BOOL aFooCalled, bFooCalled, bAltFooCalled; 29 | 30 | @interface A1 : NSObject {} 31 | - (void)foo1; 32 | @end 33 | @implementation A1 34 | - (void)foo1 { 35 | aFooCalled = YES; 36 | } 37 | @end 38 | 39 | @interface B1 : A1 {} 40 | @end 41 | @implementation B1 42 | - (void)foo1 { 43 | bFooCalled = YES; 44 | } 45 | @end 46 | 47 | @interface B1 (altFoo1) 48 | - (void)altFoo1; 49 | @end 50 | @implementation B1 (altFoo1) 51 | - (void)altFoo1 { 52 | bAltFooCalled = YES; 53 | } 54 | @end 55 | 56 | @interface A2 : NSObject {} 57 | - (void)foo2; 58 | @end 59 | @implementation A2 60 | - (void)foo2 { 61 | aFooCalled = YES; 62 | } 63 | @end 64 | 65 | @interface B2 : A2 {} 66 | @end 67 | @implementation B2 68 | @end 69 | 70 | @interface B2 (altFoo2) 71 | - (void)altFoo2; 72 | @end 73 | @implementation B2 (altFoo2) 74 | - (void)altFoo2 { 75 | bAltFooCalled = YES; 76 | } 77 | @end 78 | 79 | @implementation ClassicSwizzleTest 80 | 81 | - (void)testClassicSwizzleOfDirectMethod { 82 | A1 *a = [[[A1 alloc] init] autorelease]; 83 | B1 *b = [[[B1 alloc] init] autorelease]; 84 | 85 | { 86 | aFooCalled = bFooCalled = bAltFooCalled = NO; 87 | [a foo1]; 88 | STAssertTrue(aFooCalled, nil); 89 | STAssertFalse(bFooCalled, nil); 90 | STAssertFalse(bAltFooCalled, nil); 91 | 92 | aFooCalled = bFooCalled = bAltFooCalled = NO; 93 | [b foo1]; 94 | STAssertFalse(aFooCalled, nil); 95 | STAssertTrue(bFooCalled, nil); 96 | STAssertFalse(bAltFooCalled, nil); 97 | } 98 | 99 | ClassicMethodSwizzle([B1 class], @selector(foo1), @selector(altFoo1)); 100 | 101 | { 102 | aFooCalled = bFooCalled = bAltFooCalled = NO; 103 | [a foo1]; 104 | STAssertTrue(aFooCalled, nil); 105 | STAssertFalse(bFooCalled, nil); 106 | STAssertFalse(bAltFooCalled, nil); 107 | 108 | aFooCalled = bFooCalled = bAltFooCalled = NO; 109 | [b foo1]; 110 | STAssertFalse(aFooCalled, nil); 111 | STAssertFalse(bFooCalled, nil); 112 | STAssertTrue(bAltFooCalled, nil); 113 | } 114 | } 115 | 116 | - (void)testClassicSwizzleOfInheritedMethod { 117 | A2 *a = [[[A2 alloc] init] autorelease]; 118 | B2 *b = [[[B2 alloc] init] autorelease]; 119 | 120 | { 121 | aFooCalled = bFooCalled = bAltFooCalled = NO; 122 | [a foo2]; 123 | STAssertTrue(aFooCalled, nil); 124 | STAssertFalse(bFooCalled, nil); 125 | STAssertFalse(bAltFooCalled, nil); 126 | 127 | aFooCalled = bFooCalled = bAltFooCalled = NO; 128 | [b foo2]; 129 | STAssertTrue(aFooCalled, nil); 130 | STAssertFalse(bFooCalled, nil); 131 | STAssertFalse(bAltFooCalled, nil); 132 | } 133 | 134 | ClassicMethodSwizzle([B2 class], @selector(foo2), @selector(altFoo2)); 135 | 136 | { 137 | aFooCalled = bFooCalled = bAltFooCalled = NO; 138 | [a foo2]; 139 | STAssertFalse(aFooCalled, nil); // KNOWN INCORRECT BEHAVIOR: [a foo2] resulted in calling B2(altFoo2)'s -altFoo2! 140 | STAssertFalse(bFooCalled, nil); 141 | STAssertTrue(bAltFooCalled, nil); 142 | 143 | aFooCalled = bFooCalled = bAltFooCalled = NO; 144 | [b foo2]; 145 | STAssertFalse(aFooCalled, nil); 146 | STAssertFalse(bFooCalled, nil); 147 | STAssertTrue(bAltFooCalled, nil); 148 | } 149 | } 150 | 151 | @end 152 | -------------------------------------------------------------------------------- /JRSwizzleTest/JRSwizzleTest.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface JRSwizzleTest : SenTestCase {} 4 | @end -------------------------------------------------------------------------------- /JRSwizzleTest/JRSwizzleTest.m: -------------------------------------------------------------------------------- 1 | #import "JRSwizzleTest.h" 2 | #import "JRSwizzle.h" 3 | 4 | BOOL aFooCalled, bFooCalled, bAltFooCalled; 5 | 6 | #pragma mark - 7 | #pragma mark Scenario 7: Test JRSwizzle of Direct Implementation 8 | #pragma mark - 9 | 10 | @interface A7 : NSObject {} 11 | - (void)foo7; 12 | @end 13 | @implementation A7 14 | - (void)foo7 { 15 | aFooCalled = YES; 16 | } 17 | @end 18 | 19 | @interface B7 : A7 {} 20 | @end 21 | @implementation B7 22 | - (void)foo7 { 23 | bFooCalled = YES; 24 | } 25 | @end 26 | 27 | @interface B7 (altFoo7) 28 | - (void)altFoo7; 29 | @end 30 | @implementation B7 (altFoo7) 31 | - (void)altFoo7 { 32 | bAltFooCalled = YES; 33 | } 34 | @end 35 | 36 | @interface JRSwizzleTest (testJRSwizzleOfDirectMethod) 37 | - (void)testJRSwizzleOfDirectMethod; 38 | @end 39 | @implementation JRSwizzleTest (testJRSwizzleOfDirectMethod) 40 | 41 | - (void)testJRSwizzleOfDirectMethod { 42 | A7 *a = [[[A7 alloc] init] autorelease]; 43 | B7 *b = [[[B7 alloc] init] autorelease]; 44 | 45 | { 46 | aFooCalled = bFooCalled = bAltFooCalled = NO; 47 | [a foo7]; 48 | STAssertTrue(aFooCalled, nil); 49 | STAssertFalse(bFooCalled, nil); 50 | STAssertFalse(bAltFooCalled, nil); 51 | 52 | aFooCalled = bFooCalled = bAltFooCalled = NO; 53 | [b foo7]; 54 | STAssertFalse(aFooCalled, nil); 55 | STAssertTrue(bFooCalled, nil); 56 | STAssertFalse(bAltFooCalled, nil); 57 | } 58 | 59 | NSError *error = nil; 60 | [B7 jr_swizzleMethod:@selector(foo7) 61 | withMethod:@selector(altFoo7) 62 | error:&error]; 63 | STAssertNil(error, nil); 64 | 65 | { 66 | aFooCalled = bFooCalled = bAltFooCalled = NO; 67 | [a foo7]; 68 | STAssertTrue(aFooCalled, nil); 69 | STAssertFalse(bFooCalled, nil); 70 | STAssertFalse(bAltFooCalled, nil); 71 | 72 | aFooCalled = bFooCalled = bAltFooCalled = NO; 73 | [b foo7]; 74 | STAssertFalse(aFooCalled, nil); 75 | STAssertFalse(bFooCalled, nil); 76 | STAssertTrue(bAltFooCalled, nil); 77 | } 78 | } 79 | 80 | @end 81 | 82 | #pragma mark - 83 | #pragma mark Scenario 8: Test JRSwizzle of Inherited Implementation 84 | #pragma mark - 85 | 86 | @interface A8 : NSObject {} 87 | - (void)foo8; 88 | @end 89 | @implementation A8 90 | - (void)foo8 { 91 | aFooCalled = YES; 92 | } 93 | @end 94 | 95 | @interface B8 : A8 {} 96 | @end 97 | @implementation B8 98 | @end 99 | 100 | @interface B8 (altFoo8) 101 | - (void)altFoo8; 102 | @end 103 | @implementation B8 (altFoo8) 104 | - (void)altFoo8 { 105 | bAltFooCalled = YES; 106 | } 107 | @end 108 | 109 | @interface JRSwizzleTest (testJRSwizzleOfInheritedMethod) 110 | - (void)testJRSwizzleOfInheritedMethod; 111 | @end 112 | @implementation JRSwizzleTest (testJRSwizzleOfInheritedMethod) 113 | 114 | - (void)testJRSwizzleOfInheritedMethod { 115 | A8 *a = [[[A8 alloc] init] autorelease]; 116 | B8 *b = [[[B8 alloc] init] autorelease]; 117 | 118 | { 119 | aFooCalled = bFooCalled = bAltFooCalled = NO; 120 | [a foo8]; 121 | STAssertTrue(aFooCalled, nil); 122 | STAssertFalse(bFooCalled, nil); 123 | STAssertFalse(bAltFooCalled, nil); 124 | 125 | aFooCalled = bFooCalled = bAltFooCalled = NO; 126 | [b foo8]; 127 | STAssertTrue(aFooCalled, nil); 128 | STAssertFalse(bFooCalled, nil); 129 | STAssertFalse(bAltFooCalled, nil); 130 | } 131 | 132 | NSError *error = nil; 133 | [B8 jr_swizzleMethod:@selector(foo8) 134 | withMethod:@selector(altFoo8) 135 | error:&error]; 136 | STAssertNil(error, nil); 137 | 138 | { 139 | aFooCalled = bFooCalled = bAltFooCalled = NO; 140 | [a foo8]; 141 | STAssertTrue(aFooCalled, nil); // CORRECT BEHAVIOR 142 | STAssertFalse(bFooCalled, nil); 143 | STAssertFalse(bAltFooCalled, nil); 144 | 145 | aFooCalled = bFooCalled = bAltFooCalled = NO; 146 | [b foo8]; 147 | STAssertFalse(aFooCalled, nil); 148 | STAssertFalse(bFooCalled, nil); 149 | STAssertTrue(bAltFooCalled, nil); 150 | } 151 | } 152 | 153 | @end 154 | 155 | @implementation JRSwizzleTest 156 | @end -------------------------------------------------------------------------------- /JRSwizzleTest/JRSwizzleTest.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 44; 7 | objects = { 8 | 9 | /* Begin PBXAggregateTarget section */ 10 | 79F3DBFA0CF33EE500733703 /* All Tests */ = { 11 | isa = PBXAggregateTarget; 12 | buildConfigurationList = 79F3DC0C0CF33EFB00733703 /* Build configuration list for PBXAggregateTarget "All Tests" */; 13 | buildPhases = ( 14 | ); 15 | dependencies = ( 16 | 792609490CF3FA4A00A93D12 /* PBXTargetDependency */, 17 | 7926085F0CF3F32700A93D12 /* PBXTargetDependency */, 18 | 79F3DC3E0CF358B300733703 /* PBXTargetDependency */, 19 | 79F3DC400CF358B300733703 /* PBXTargetDependency */, 20 | ); 21 | name = "All Tests"; 22 | productName = "All Tests"; 23 | }; 24 | /* End PBXAggregateTarget section */ 25 | 26 | /* Begin PBXBuildFile section */ 27 | 7926079B0CF3EE5400A93D12 /* AppleSwizzleTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 79F3DC870CF3EAAD00733703 /* AppleSwizzleTest.m */; }; 28 | 792607C80CF3F0A900A93D12 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08FB779EFE84155DC02AAC07 /* Foundation.framework */; }; 29 | 792608460CF3F0AE00A93D12 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 08FB7796FE84155DC02AAC07 /* main.m */; }; 30 | 792608640CF3F34000A93D12 /* BallardSwizzleTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 79F3DC5E0CF36BC300733703 /* BallardSwizzleTest.m */; }; 31 | 792608650CF3F34100A93D12 /* ClassicSwizzleTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 79F3DC1C0CF3411300733703 /* ClassicSwizzleTest.m */; }; 32 | 792608690CF3F36900A93D12 /* MethodSwizzle.m in Sources */ = {isa = PBXBuildFile; fileRef = 79F3DC540CF36B3500733703 /* MethodSwizzle.m */; }; 33 | 792608800CF3F57B00A93D12 /* JRSwizzle.m in Sources */ = {isa = PBXBuildFile; fileRef = 7926087E0CF3F57B00A93D12 /* JRSwizzle.m */; }; 34 | 792608810CF3F57B00A93D12 /* JRSwizzle.m in Sources */ = {isa = PBXBuildFile; fileRef = 7926087E0CF3F57B00A93D12 /* JRSwizzle.m */; }; 35 | 792608820CF3F57B00A93D12 /* JRSwizzle.m in Sources */ = {isa = PBXBuildFile; fileRef = 7926087E0CF3F57B00A93D12 /* JRSwizzle.m */; }; 36 | 792608880CF3F6BF00A93D12 /* JRSwizzleTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 792608870CF3F6BF00A93D12 /* JRSwizzleTest.m */; }; 37 | 792608890CF3F6BF00A93D12 /* JRSwizzleTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 792608870CF3F6BF00A93D12 /* JRSwizzleTest.m */; }; 38 | 7926088A0CF3F6BF00A93D12 /* JRSwizzleTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 792608870CF3F6BF00A93D12 /* JRSwizzleTest.m */; }; 39 | 792608A80CF3F8DA00A93D12 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08FB779EFE84155DC02AAC07 /* Foundation.framework */; }; 40 | 792609260CF3F8E500A93D12 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 08FB7796FE84155DC02AAC07 /* main.m */; }; 41 | 7926094C0CF3FA6400A93D12 /* BallardSwizzleTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 79F3DC5E0CF36BC300733703 /* BallardSwizzleTest.m */; }; 42 | 7926094D0CF3FA6500A93D12 /* ClassicSwizzleTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 79F3DC1C0CF3411300733703 /* ClassicSwizzleTest.m */; }; 43 | 7926094E0CF3FA6600A93D12 /* JRSwizzleTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 792608870CF3F6BF00A93D12 /* JRSwizzleTest.m */; }; 44 | 792609500CF3FA7400A93D12 /* MethodSwizzle.m in Sources */ = {isa = PBXBuildFile; fileRef = 79F3DC540CF36B3500733703 /* MethodSwizzle.m */; }; 45 | 792609510CF3FA7700A93D12 /* JRSwizzle.m in Sources */ = {isa = PBXBuildFile; fileRef = 7926087E0CF3F57B00A93D12 /* JRSwizzle.m */; }; 46 | 79F3DBE80CF33E6000733703 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 08FB7796FE84155DC02AAC07 /* main.m */; settings = {ATTRIBUTES = (); }; }; 47 | 79F3DBEA0CF33E6000733703 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08FB779EFE84155DC02AAC07 /* Foundation.framework */; }; 48 | 79F3DC1D0CF3411300733703 /* ClassicSwizzleTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 79F3DC1C0CF3411300733703 /* ClassicSwizzleTest.m */; }; 49 | 79F3DC560CF36B3500733703 /* MethodSwizzle.m in Sources */ = {isa = PBXBuildFile; fileRef = 79F3DC540CF36B3500733703 /* MethodSwizzle.m */; }; 50 | 79F3DC5F0CF36BC300733703 /* BallardSwizzleTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 79F3DC5E0CF36BC300733703 /* BallardSwizzleTest.m */; }; 51 | 79F3DC880CF3EAAD00733703 /* AppleSwizzleTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 79F3DC870CF3EAAD00733703 /* AppleSwizzleTest.m */; }; 52 | 8DD76F9A0486AA7600D96B5E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 08FB7796FE84155DC02AAC07 /* main.m */; settings = {ATTRIBUTES = (); }; }; 53 | 8DD76F9C0486AA7600D96B5E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08FB779EFE84155DC02AAC07 /* Foundation.framework */; }; 54 | /* End PBXBuildFile section */ 55 | 56 | /* Begin PBXContainerItemProxy section */ 57 | 792607970CF3EE2100A93D12 /* PBXContainerItemProxy */ = { 58 | isa = PBXContainerItemProxy; 59 | containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; 60 | proxyType = 1; 61 | remoteGlobalIDString = 79F3DBE60CF33E6000733703; 62 | remoteInfo = "10.5 64-bit"; 63 | }; 64 | 7926085C0CF3F26000A93D12 /* PBXContainerItemProxy */ = { 65 | isa = PBXContainerItemProxy; 66 | containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; 67 | proxyType = 1; 68 | remoteGlobalIDString = 792607C20CF3F05800A93D12; 69 | remoteInfo = 10.4; 70 | }; 71 | 7926085E0CF3F32700A93D12 /* PBXContainerItemProxy */ = { 72 | isa = PBXContainerItemProxy; 73 | containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; 74 | proxyType = 1; 75 | remoteGlobalIDString = 792608540CF3F24400A93D12; 76 | remoteInfo = "10.4 Test"; 77 | }; 78 | 792609480CF3FA4A00A93D12 /* PBXContainerItemProxy */ = { 79 | isa = PBXContainerItemProxy; 80 | containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; 81 | proxyType = 1; 82 | remoteGlobalIDString = 7926093E0CF3F98E00A93D12; 83 | remoteInfo = "10.3 Test"; 84 | }; 85 | 7926094A0CF3FA5300A93D12 /* PBXContainerItemProxy */ = { 86 | isa = PBXContainerItemProxy; 87 | containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; 88 | proxyType = 1; 89 | remoteGlobalIDString = 792608A20CF3F88400A93D12; 90 | remoteInfo = 10.3; 91 | }; 92 | 79F3DC1F0CF3417200733703 /* PBXContainerItemProxy */ = { 93 | isa = PBXContainerItemProxy; 94 | containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; 95 | proxyType = 1; 96 | remoteGlobalIDString = 8DD76F960486AA7600D96B5E; 97 | remoteInfo = "10.5 32-bit"; 98 | }; 99 | 79F3DC3D0CF358B300733703 /* PBXContainerItemProxy */ = { 100 | isa = PBXContainerItemProxy; 101 | containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; 102 | proxyType = 1; 103 | remoteGlobalIDString = 79F3DC140CF33F5000733703; 104 | remoteInfo = "10.5 32-bit Test"; 105 | }; 106 | 79F3DC3F0CF358B300733703 /* PBXContainerItemProxy */ = { 107 | isa = PBXContainerItemProxy; 108 | containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; 109 | proxyType = 1; 110 | remoteGlobalIDString = 79F3DC2C0CF341EC00733703; 111 | remoteInfo = "10.5 64-bit Test"; 112 | }; 113 | /* End PBXContainerItemProxy section */ 114 | 115 | /* Begin PBXFileReference section */ 116 | 08FB7796FE84155DC02AAC07 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 117 | 08FB779EFE84155DC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 118 | 32A70AAB03705E1F00C91783 /* JRSwizzleTest_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JRSwizzleTest_Prefix.pch; sourceTree = ""; }; 119 | 792607C30CF3F05800A93D12 /* JRSwizzleTest_1040 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = JRSwizzleTest_1040; sourceTree = BUILT_PRODUCTS_DIR; }; 120 | 792608550CF3F24400A93D12 /* 10.4 Test.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "10.4 Test.octest"; sourceTree = BUILT_PRODUCTS_DIR; }; 121 | 792608560CF3F24400A93D12 /* 10.4 Test-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "10.4 Test-Info.plist"; sourceTree = ""; }; 122 | 7926087E0CF3F57B00A93D12 /* JRSwizzle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = JRSwizzle.m; path = ../JRSwizzle.m; sourceTree = ""; }; 123 | 7926087F0CF3F57B00A93D12 /* JRSwizzle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JRSwizzle.h; path = ../JRSwizzle.h; sourceTree = ""; }; 124 | 792608860CF3F6BF00A93D12 /* JRSwizzleTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JRSwizzleTest.h; sourceTree = ""; }; 125 | 792608870CF3F6BF00A93D12 /* JRSwizzleTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JRSwizzleTest.m; sourceTree = ""; }; 126 | 792608A30CF3F88400A93D12 /* JRSwizzleTest_1030 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = JRSwizzleTest_1030; sourceTree = BUILT_PRODUCTS_DIR; }; 127 | 7926093F0CF3F98E00A93D12 /* 10.3 Test.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "10.3 Test.octest"; sourceTree = BUILT_PRODUCTS_DIR; }; 128 | 792609400CF3F98E00A93D12 /* 10.3 Test-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "10.3 Test-Info.plist"; sourceTree = ""; }; 129 | 79F3DBEE0CF33E6000733703 /* JRSwizzleTest_1050_64 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = JRSwizzleTest_1050_64; sourceTree = BUILT_PRODUCTS_DIR; }; 130 | 79F3DC150CF33F5000733703 /* 10.5 32-bit Test.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "10.5 32-bit Test.octest"; sourceTree = BUILT_PRODUCTS_DIR; }; 131 | 79F3DC160CF33F5000733703 /* 10.5 32-bit Test-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "10.5 32-bit Test-Info.plist"; sourceTree = ""; }; 132 | 79F3DC1B0CF3411300733703 /* ClassicSwizzleTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClassicSwizzleTest.h; sourceTree = ""; }; 133 | 79F3DC1C0CF3411300733703 /* ClassicSwizzleTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ClassicSwizzleTest.m; sourceTree = ""; }; 134 | 79F3DC2D0CF341EC00733703 /* 10.5 64-bit Test.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "10.5 64-bit Test.octest"; sourceTree = BUILT_PRODUCTS_DIR; }; 135 | 79F3DC2E0CF341EC00733703 /* 10.5 64-bit Test-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "10.5 64-bit Test-Info.plist"; sourceTree = ""; }; 136 | 79F3DC540CF36B3500733703 /* MethodSwizzle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MethodSwizzle.m; sourceTree = ""; }; 137 | 79F3DC550CF36B3500733703 /* MethodSwizzle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MethodSwizzle.h; sourceTree = ""; }; 138 | 79F3DC5D0CF36BC300733703 /* BallardSwizzleTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BallardSwizzleTest.h; sourceTree = ""; }; 139 | 79F3DC5E0CF36BC300733703 /* BallardSwizzleTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BallardSwizzleTest.m; sourceTree = ""; }; 140 | 79F3DC860CF3EAAD00733703 /* AppleSwizzleTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppleSwizzleTest.h; sourceTree = ""; }; 141 | 79F3DC870CF3EAAD00733703 /* AppleSwizzleTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppleSwizzleTest.m; sourceTree = ""; }; 142 | 8DD76FA10486AA7600D96B5E /* JRSwizzleTest_1050_32 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = JRSwizzleTest_1050_32; sourceTree = BUILT_PRODUCTS_DIR; }; 143 | /* End PBXFileReference section */ 144 | 145 | /* Begin PBXFrameworksBuildPhase section */ 146 | 792607C10CF3F05800A93D12 /* Frameworks */ = { 147 | isa = PBXFrameworksBuildPhase; 148 | buildActionMask = 2147483647; 149 | files = ( 150 | 792607C80CF3F0A900A93D12 /* Foundation.framework in Frameworks */, 151 | ); 152 | runOnlyForDeploymentPostprocessing = 0; 153 | }; 154 | 792608520CF3F24400A93D12 /* Frameworks */ = { 155 | isa = PBXFrameworksBuildPhase; 156 | buildActionMask = 2147483647; 157 | files = ( 158 | ); 159 | runOnlyForDeploymentPostprocessing = 0; 160 | }; 161 | 792608A10CF3F88400A93D12 /* Frameworks */ = { 162 | isa = PBXFrameworksBuildPhase; 163 | buildActionMask = 2147483647; 164 | files = ( 165 | 792608A80CF3F8DA00A93D12 /* Foundation.framework in Frameworks */, 166 | ); 167 | runOnlyForDeploymentPostprocessing = 0; 168 | }; 169 | 7926093C0CF3F98E00A93D12 /* Frameworks */ = { 170 | isa = PBXFrameworksBuildPhase; 171 | buildActionMask = 2147483647; 172 | files = ( 173 | ); 174 | runOnlyForDeploymentPostprocessing = 0; 175 | }; 176 | 79F3DBE90CF33E6000733703 /* Frameworks */ = { 177 | isa = PBXFrameworksBuildPhase; 178 | buildActionMask = 2147483647; 179 | files = ( 180 | 79F3DBEA0CF33E6000733703 /* Foundation.framework in Frameworks */, 181 | ); 182 | runOnlyForDeploymentPostprocessing = 0; 183 | }; 184 | 79F3DC120CF33F5000733703 /* Frameworks */ = { 185 | isa = PBXFrameworksBuildPhase; 186 | buildActionMask = 2147483647; 187 | files = ( 188 | ); 189 | runOnlyForDeploymentPostprocessing = 0; 190 | }; 191 | 79F3DC2A0CF341EC00733703 /* Frameworks */ = { 192 | isa = PBXFrameworksBuildPhase; 193 | buildActionMask = 2147483647; 194 | files = ( 195 | ); 196 | runOnlyForDeploymentPostprocessing = 0; 197 | }; 198 | 8DD76F9B0486AA7600D96B5E /* Frameworks */ = { 199 | isa = PBXFrameworksBuildPhase; 200 | buildActionMask = 2147483647; 201 | files = ( 202 | 8DD76F9C0486AA7600D96B5E /* Foundation.framework in Frameworks */, 203 | ); 204 | runOnlyForDeploymentPostprocessing = 0; 205 | }; 206 | /* End PBXFrameworksBuildPhase section */ 207 | 208 | /* Begin PBXGroup section */ 209 | 08FB7794FE84155DC02AAC07 /* JRSwizzleTest */ = { 210 | isa = PBXGroup; 211 | children = ( 212 | 79F3DC4B0CF36AC400733703 /* Tests */, 213 | 08FB7795FE84155DC02AAC07 /* Source */, 214 | 08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */, 215 | 1AB674ADFE9D54B511CA2CBB /* Products */, 216 | 792609400CF3F98E00A93D12 /* 10.3 Test-Info.plist */, 217 | 792608560CF3F24400A93D12 /* 10.4 Test-Info.plist */, 218 | 79F3DC160CF33F5000733703 /* 10.5 32-bit Test-Info.plist */, 219 | 79F3DC2E0CF341EC00733703 /* 10.5 64-bit Test-Info.plist */, 220 | ); 221 | name = JRSwizzleTest; 222 | sourceTree = ""; 223 | }; 224 | 08FB7795FE84155DC02AAC07 /* Source */ = { 225 | isa = PBXGroup; 226 | children = ( 227 | 08FB7796FE84155DC02AAC07 /* main.m */, 228 | 7926087F0CF3F57B00A93D12 /* JRSwizzle.h */, 229 | 7926087E0CF3F57B00A93D12 /* JRSwizzle.m */, 230 | 79F3DC550CF36B3500733703 /* MethodSwizzle.h */, 231 | 79F3DC540CF36B3500733703 /* MethodSwizzle.m */, 232 | 32A70AAB03705E1F00C91783 /* JRSwizzleTest_Prefix.pch */, 233 | ); 234 | name = Source; 235 | sourceTree = ""; 236 | }; 237 | 08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */ = { 238 | isa = PBXGroup; 239 | children = ( 240 | 08FB779EFE84155DC02AAC07 /* Foundation.framework */, 241 | ); 242 | name = "External Frameworks and Libraries"; 243 | sourceTree = ""; 244 | }; 245 | 1AB674ADFE9D54B511CA2CBB /* Products */ = { 246 | isa = PBXGroup; 247 | children = ( 248 | 8DD76FA10486AA7600D96B5E /* JRSwizzleTest_1050_32 */, 249 | 79F3DBEE0CF33E6000733703 /* JRSwizzleTest_1050_64 */, 250 | 79F3DC150CF33F5000733703 /* 10.5 32-bit Test.octest */, 251 | 79F3DC2D0CF341EC00733703 /* 10.5 64-bit Test.octest */, 252 | 792607C30CF3F05800A93D12 /* JRSwizzleTest_1040 */, 253 | 792608550CF3F24400A93D12 /* 10.4 Test.octest */, 254 | 792608A30CF3F88400A93D12 /* JRSwizzleTest_1030 */, 255 | 7926093F0CF3F98E00A93D12 /* 10.3 Test.octest */, 256 | ); 257 | name = Products; 258 | sourceTree = ""; 259 | }; 260 | 79F3DC4B0CF36AC400733703 /* Tests */ = { 261 | isa = PBXGroup; 262 | children = ( 263 | 79F3DC1B0CF3411300733703 /* ClassicSwizzleTest.h */, 264 | 79F3DC1C0CF3411300733703 /* ClassicSwizzleTest.m */, 265 | 79F3DC5D0CF36BC300733703 /* BallardSwizzleTest.h */, 266 | 79F3DC5E0CF36BC300733703 /* BallardSwizzleTest.m */, 267 | 79F3DC860CF3EAAD00733703 /* AppleSwizzleTest.h */, 268 | 79F3DC870CF3EAAD00733703 /* AppleSwizzleTest.m */, 269 | 792608860CF3F6BF00A93D12 /* JRSwizzleTest.h */, 270 | 792608870CF3F6BF00A93D12 /* JRSwizzleTest.m */, 271 | ); 272 | name = Tests; 273 | sourceTree = ""; 274 | }; 275 | /* End PBXGroup section */ 276 | 277 | /* Begin PBXNativeTarget section */ 278 | 792607C20CF3F05800A93D12 /* 10.4 */ = { 279 | isa = PBXNativeTarget; 280 | buildConfigurationList = 792607C70CF3F09500A93D12 /* Build configuration list for PBXNativeTarget "10.4" */; 281 | buildPhases = ( 282 | 792607C00CF3F05800A93D12 /* Sources */, 283 | 792607C10CF3F05800A93D12 /* Frameworks */, 284 | ); 285 | buildRules = ( 286 | ); 287 | dependencies = ( 288 | ); 289 | name = 10.4; 290 | productName = 10.4; 291 | productReference = 792607C30CF3F05800A93D12 /* JRSwizzleTest_1040 */; 292 | productType = "com.apple.product-type.tool"; 293 | }; 294 | 792608540CF3F24400A93D12 /* 10.4 Test */ = { 295 | isa = PBXNativeTarget; 296 | buildConfigurationList = 792608590CF3F24400A93D12 /* Build configuration list for PBXNativeTarget "10.4 Test" */; 297 | buildPhases = ( 298 | 792608500CF3F24400A93D12 /* Resources */, 299 | 792608510CF3F24400A93D12 /* Sources */, 300 | 792608520CF3F24400A93D12 /* Frameworks */, 301 | 792608530CF3F24400A93D12 /* ShellScript */, 302 | ); 303 | buildRules = ( 304 | ); 305 | dependencies = ( 306 | 7926085D0CF3F26000A93D12 /* PBXTargetDependency */, 307 | ); 308 | name = "10.4 Test"; 309 | productName = "10.4 Test"; 310 | productReference = 792608550CF3F24400A93D12 /* 10.4 Test.octest */; 311 | productType = "com.apple.product-type.bundle"; 312 | }; 313 | 792608A20CF3F88400A93D12 /* 10.3 */ = { 314 | isa = PBXNativeTarget; 315 | buildConfigurationList = 792608A70CF3F8AC00A93D12 /* Build configuration list for PBXNativeTarget "10.3" */; 316 | buildPhases = ( 317 | 792608A00CF3F88400A93D12 /* Sources */, 318 | 792608A10CF3F88400A93D12 /* Frameworks */, 319 | ); 320 | buildRules = ( 321 | ); 322 | dependencies = ( 323 | ); 324 | name = 10.3; 325 | productName = 10.3; 326 | productReference = 792608A30CF3F88400A93D12 /* JRSwizzleTest_1030 */; 327 | productType = "com.apple.product-type.tool"; 328 | }; 329 | 7926093E0CF3F98E00A93D12 /* 10.3 Test */ = { 330 | isa = PBXNativeTarget; 331 | buildConfigurationList = 792609430CF3F98E00A93D12 /* Build configuration list for PBXNativeTarget "10.3 Test" */; 332 | buildPhases = ( 333 | 7926093A0CF3F98E00A93D12 /* Resources */, 334 | 7926093B0CF3F98E00A93D12 /* Sources */, 335 | 7926093C0CF3F98E00A93D12 /* Frameworks */, 336 | 7926093D0CF3F98E00A93D12 /* ShellScript */, 337 | ); 338 | buildRules = ( 339 | ); 340 | dependencies = ( 341 | 7926094B0CF3FA5300A93D12 /* PBXTargetDependency */, 342 | ); 343 | name = "10.3 Test"; 344 | productName = "10.3 Test"; 345 | productReference = 7926093F0CF3F98E00A93D12 /* 10.3 Test.octest */; 346 | productType = "com.apple.product-type.bundle"; 347 | }; 348 | 79F3DBE60CF33E6000733703 /* 10.5 64-bit */ = { 349 | isa = PBXNativeTarget; 350 | buildConfigurationList = 79F3DBEB0CF33E6000733703 /* Build configuration list for PBXNativeTarget "10.5 64-bit" */; 351 | buildPhases = ( 352 | 79F3DBE70CF33E6000733703 /* Sources */, 353 | 79F3DBE90CF33E6000733703 /* Frameworks */, 354 | ); 355 | buildRules = ( 356 | ); 357 | dependencies = ( 358 | ); 359 | name = "10.5 64-bit"; 360 | productInstallPath = "$(HOME)/bin"; 361 | productName = JRSwizzleTest; 362 | productReference = 79F3DBEE0CF33E6000733703 /* JRSwizzleTest_1050_64 */; 363 | productType = "com.apple.product-type.tool"; 364 | }; 365 | 79F3DC140CF33F5000733703 /* 10.5 32-bit Test */ = { 366 | isa = PBXNativeTarget; 367 | buildConfigurationList = 79F3DC190CF33F5100733703 /* Build configuration list for PBXNativeTarget "10.5 32-bit Test" */; 368 | buildPhases = ( 369 | 79F3DC100CF33F5000733703 /* Resources */, 370 | 79F3DC110CF33F5000733703 /* Sources */, 371 | 79F3DC120CF33F5000733703 /* Frameworks */, 372 | 79F3DC130CF33F5000733703 /* ShellScript */, 373 | ); 374 | buildRules = ( 375 | ); 376 | dependencies = ( 377 | 79F3DC200CF3417200733703 /* PBXTargetDependency */, 378 | ); 379 | name = "10.5 32-bit Test"; 380 | productName = "10.5 32-bit Test"; 381 | productReference = 79F3DC150CF33F5000733703 /* 10.5 32-bit Test.octest */; 382 | productType = "com.apple.product-type.bundle"; 383 | }; 384 | 79F3DC2C0CF341EC00733703 /* 10.5 64-bit Test */ = { 385 | isa = PBXNativeTarget; 386 | buildConfigurationList = 79F3DC310CF341EC00733703 /* Build configuration list for PBXNativeTarget "10.5 64-bit Test" */; 387 | buildPhases = ( 388 | 79F3DC280CF341EC00733703 /* Resources */, 389 | 79F3DC290CF341EC00733703 /* Sources */, 390 | 79F3DC2A0CF341EC00733703 /* Frameworks */, 391 | 79F3DC2B0CF341EC00733703 /* ShellScript */, 392 | ); 393 | buildRules = ( 394 | ); 395 | dependencies = ( 396 | 792607980CF3EE2100A93D12 /* PBXTargetDependency */, 397 | ); 398 | name = "10.5 64-bit Test"; 399 | productName = "10.5 64-bit Test"; 400 | productReference = 79F3DC2D0CF341EC00733703 /* 10.5 64-bit Test.octest */; 401 | productType = "com.apple.product-type.bundle"; 402 | }; 403 | 8DD76F960486AA7600D96B5E /* 10.5 32-bit */ = { 404 | isa = PBXNativeTarget; 405 | buildConfigurationList = 1DEB927408733DD40010E9CD /* Build configuration list for PBXNativeTarget "10.5 32-bit" */; 406 | buildPhases = ( 407 | 8DD76F990486AA7600D96B5E /* Sources */, 408 | 8DD76F9B0486AA7600D96B5E /* Frameworks */, 409 | ); 410 | buildRules = ( 411 | ); 412 | dependencies = ( 413 | ); 414 | name = "10.5 32-bit"; 415 | productInstallPath = "$(HOME)/bin"; 416 | productName = JRSwizzleTest; 417 | productReference = 8DD76FA10486AA7600D96B5E /* JRSwizzleTest_1050_32 */; 418 | productType = "com.apple.product-type.tool"; 419 | }; 420 | /* End PBXNativeTarget section */ 421 | 422 | /* Begin PBXProject section */ 423 | 08FB7793FE84155DC02AAC07 /* Project object */ = { 424 | isa = PBXProject; 425 | buildConfigurationList = 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "JRSwizzleTest" */; 426 | compatibilityVersion = "Xcode 3.0"; 427 | hasScannedForEncodings = 1; 428 | mainGroup = 08FB7794FE84155DC02AAC07 /* JRSwizzleTest */; 429 | projectDirPath = ""; 430 | projectRoot = ""; 431 | targets = ( 432 | 79F3DBFA0CF33EE500733703 /* All Tests */, 433 | 792608A20CF3F88400A93D12 /* 10.3 */, 434 | 792607C20CF3F05800A93D12 /* 10.4 */, 435 | 8DD76F960486AA7600D96B5E /* 10.5 32-bit */, 436 | 79F3DBE60CF33E6000733703 /* 10.5 64-bit */, 437 | 7926093E0CF3F98E00A93D12 /* 10.3 Test */, 438 | 792608540CF3F24400A93D12 /* 10.4 Test */, 439 | 79F3DC140CF33F5000733703 /* 10.5 32-bit Test */, 440 | 79F3DC2C0CF341EC00733703 /* 10.5 64-bit Test */, 441 | ); 442 | }; 443 | /* End PBXProject section */ 444 | 445 | /* Begin PBXResourcesBuildPhase section */ 446 | 792608500CF3F24400A93D12 /* Resources */ = { 447 | isa = PBXResourcesBuildPhase; 448 | buildActionMask = 2147483647; 449 | files = ( 450 | ); 451 | runOnlyForDeploymentPostprocessing = 0; 452 | }; 453 | 7926093A0CF3F98E00A93D12 /* Resources */ = { 454 | isa = PBXResourcesBuildPhase; 455 | buildActionMask = 2147483647; 456 | files = ( 457 | ); 458 | runOnlyForDeploymentPostprocessing = 0; 459 | }; 460 | 79F3DC100CF33F5000733703 /* Resources */ = { 461 | isa = PBXResourcesBuildPhase; 462 | buildActionMask = 2147483647; 463 | files = ( 464 | ); 465 | runOnlyForDeploymentPostprocessing = 0; 466 | }; 467 | 79F3DC280CF341EC00733703 /* Resources */ = { 468 | isa = PBXResourcesBuildPhase; 469 | buildActionMask = 2147483647; 470 | files = ( 471 | ); 472 | runOnlyForDeploymentPostprocessing = 0; 473 | }; 474 | /* End PBXResourcesBuildPhase section */ 475 | 476 | /* Begin PBXShellScriptBuildPhase section */ 477 | 792608530CF3F24400A93D12 /* ShellScript */ = { 478 | isa = PBXShellScriptBuildPhase; 479 | buildActionMask = 2147483647; 480 | files = ( 481 | ); 482 | inputPaths = ( 483 | ); 484 | outputPaths = ( 485 | ); 486 | runOnlyForDeploymentPostprocessing = 0; 487 | shellPath = /bin/sh; 488 | shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; 489 | }; 490 | 7926093D0CF3F98E00A93D12 /* ShellScript */ = { 491 | isa = PBXShellScriptBuildPhase; 492 | buildActionMask = 2147483647; 493 | files = ( 494 | ); 495 | inputPaths = ( 496 | ); 497 | outputPaths = ( 498 | ); 499 | runOnlyForDeploymentPostprocessing = 0; 500 | shellPath = /bin/sh; 501 | shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; 502 | }; 503 | 79F3DC130CF33F5000733703 /* ShellScript */ = { 504 | isa = PBXShellScriptBuildPhase; 505 | buildActionMask = 2147483647; 506 | files = ( 507 | ); 508 | inputPaths = ( 509 | ); 510 | outputPaths = ( 511 | ); 512 | runOnlyForDeploymentPostprocessing = 0; 513 | shellPath = /bin/sh; 514 | shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; 515 | }; 516 | 79F3DC2B0CF341EC00733703 /* ShellScript */ = { 517 | isa = PBXShellScriptBuildPhase; 518 | buildActionMask = 2147483647; 519 | files = ( 520 | ); 521 | inputPaths = ( 522 | ); 523 | outputPaths = ( 524 | ); 525 | runOnlyForDeploymentPostprocessing = 0; 526 | shellPath = /bin/sh; 527 | shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; 528 | }; 529 | /* End PBXShellScriptBuildPhase section */ 530 | 531 | /* Begin PBXSourcesBuildPhase section */ 532 | 792607C00CF3F05800A93D12 /* Sources */ = { 533 | isa = PBXSourcesBuildPhase; 534 | buildActionMask = 2147483647; 535 | files = ( 536 | 792608460CF3F0AE00A93D12 /* main.m in Sources */, 537 | ); 538 | runOnlyForDeploymentPostprocessing = 0; 539 | }; 540 | 792608510CF3F24400A93D12 /* Sources */ = { 541 | isa = PBXSourcesBuildPhase; 542 | buildActionMask = 2147483647; 543 | files = ( 544 | 792608640CF3F34000A93D12 /* BallardSwizzleTest.m in Sources */, 545 | 792608650CF3F34100A93D12 /* ClassicSwizzleTest.m in Sources */, 546 | 792608690CF3F36900A93D12 /* MethodSwizzle.m in Sources */, 547 | 792608820CF3F57B00A93D12 /* JRSwizzle.m in Sources */, 548 | 792608880CF3F6BF00A93D12 /* JRSwizzleTest.m in Sources */, 549 | ); 550 | runOnlyForDeploymentPostprocessing = 0; 551 | }; 552 | 792608A00CF3F88400A93D12 /* Sources */ = { 553 | isa = PBXSourcesBuildPhase; 554 | buildActionMask = 2147483647; 555 | files = ( 556 | 792609260CF3F8E500A93D12 /* main.m in Sources */, 557 | ); 558 | runOnlyForDeploymentPostprocessing = 0; 559 | }; 560 | 7926093B0CF3F98E00A93D12 /* Sources */ = { 561 | isa = PBXSourcesBuildPhase; 562 | buildActionMask = 2147483647; 563 | files = ( 564 | 7926094C0CF3FA6400A93D12 /* BallardSwizzleTest.m in Sources */, 565 | 7926094D0CF3FA6500A93D12 /* ClassicSwizzleTest.m in Sources */, 566 | 7926094E0CF3FA6600A93D12 /* JRSwizzleTest.m in Sources */, 567 | 792609500CF3FA7400A93D12 /* MethodSwizzle.m in Sources */, 568 | 792609510CF3FA7700A93D12 /* JRSwizzle.m in Sources */, 569 | ); 570 | runOnlyForDeploymentPostprocessing = 0; 571 | }; 572 | 79F3DBE70CF33E6000733703 /* Sources */ = { 573 | isa = PBXSourcesBuildPhase; 574 | buildActionMask = 2147483647; 575 | files = ( 576 | 79F3DBE80CF33E6000733703 /* main.m in Sources */, 577 | ); 578 | runOnlyForDeploymentPostprocessing = 0; 579 | }; 580 | 79F3DC110CF33F5000733703 /* Sources */ = { 581 | isa = PBXSourcesBuildPhase; 582 | buildActionMask = 2147483647; 583 | files = ( 584 | 79F3DC1D0CF3411300733703 /* ClassicSwizzleTest.m in Sources */, 585 | 79F3DC560CF36B3500733703 /* MethodSwizzle.m in Sources */, 586 | 79F3DC5F0CF36BC300733703 /* BallardSwizzleTest.m in Sources */, 587 | 79F3DC880CF3EAAD00733703 /* AppleSwizzleTest.m in Sources */, 588 | 792608800CF3F57B00A93D12 /* JRSwizzle.m in Sources */, 589 | 7926088A0CF3F6BF00A93D12 /* JRSwizzleTest.m in Sources */, 590 | ); 591 | runOnlyForDeploymentPostprocessing = 0; 592 | }; 593 | 79F3DC290CF341EC00733703 /* Sources */ = { 594 | isa = PBXSourcesBuildPhase; 595 | buildActionMask = 2147483647; 596 | files = ( 597 | 7926079B0CF3EE5400A93D12 /* AppleSwizzleTest.m in Sources */, 598 | 792608810CF3F57B00A93D12 /* JRSwizzle.m in Sources */, 599 | 792608890CF3F6BF00A93D12 /* JRSwizzleTest.m in Sources */, 600 | ); 601 | runOnlyForDeploymentPostprocessing = 0; 602 | }; 603 | 8DD76F990486AA7600D96B5E /* Sources */ = { 604 | isa = PBXSourcesBuildPhase; 605 | buildActionMask = 2147483647; 606 | files = ( 607 | 8DD76F9A0486AA7600D96B5E /* main.m in Sources */, 608 | ); 609 | runOnlyForDeploymentPostprocessing = 0; 610 | }; 611 | /* End PBXSourcesBuildPhase section */ 612 | 613 | /* Begin PBXTargetDependency section */ 614 | 792607980CF3EE2100A93D12 /* PBXTargetDependency */ = { 615 | isa = PBXTargetDependency; 616 | target = 79F3DBE60CF33E6000733703 /* 10.5 64-bit */; 617 | targetProxy = 792607970CF3EE2100A93D12 /* PBXContainerItemProxy */; 618 | }; 619 | 7926085D0CF3F26000A93D12 /* PBXTargetDependency */ = { 620 | isa = PBXTargetDependency; 621 | target = 792607C20CF3F05800A93D12 /* 10.4 */; 622 | targetProxy = 7926085C0CF3F26000A93D12 /* PBXContainerItemProxy */; 623 | }; 624 | 7926085F0CF3F32700A93D12 /* PBXTargetDependency */ = { 625 | isa = PBXTargetDependency; 626 | target = 792608540CF3F24400A93D12 /* 10.4 Test */; 627 | targetProxy = 7926085E0CF3F32700A93D12 /* PBXContainerItemProxy */; 628 | }; 629 | 792609490CF3FA4A00A93D12 /* PBXTargetDependency */ = { 630 | isa = PBXTargetDependency; 631 | target = 7926093E0CF3F98E00A93D12 /* 10.3 Test */; 632 | targetProxy = 792609480CF3FA4A00A93D12 /* PBXContainerItemProxy */; 633 | }; 634 | 7926094B0CF3FA5300A93D12 /* PBXTargetDependency */ = { 635 | isa = PBXTargetDependency; 636 | target = 792608A20CF3F88400A93D12 /* 10.3 */; 637 | targetProxy = 7926094A0CF3FA5300A93D12 /* PBXContainerItemProxy */; 638 | }; 639 | 79F3DC200CF3417200733703 /* PBXTargetDependency */ = { 640 | isa = PBXTargetDependency; 641 | target = 8DD76F960486AA7600D96B5E /* 10.5 32-bit */; 642 | targetProxy = 79F3DC1F0CF3417200733703 /* PBXContainerItemProxy */; 643 | }; 644 | 79F3DC3E0CF358B300733703 /* PBXTargetDependency */ = { 645 | isa = PBXTargetDependency; 646 | target = 79F3DC140CF33F5000733703 /* 10.5 32-bit Test */; 647 | targetProxy = 79F3DC3D0CF358B300733703 /* PBXContainerItemProxy */; 648 | }; 649 | 79F3DC400CF358B300733703 /* PBXTargetDependency */ = { 650 | isa = PBXTargetDependency; 651 | target = 79F3DC2C0CF341EC00733703 /* 10.5 64-bit Test */; 652 | targetProxy = 79F3DC3F0CF358B300733703 /* PBXContainerItemProxy */; 653 | }; 654 | /* End PBXTargetDependency section */ 655 | 656 | /* Begin XCBuildConfiguration section */ 657 | 1DEB927508733DD40010E9CD /* Debug */ = { 658 | isa = XCBuildConfiguration; 659 | buildSettings = { 660 | COPY_PHASE_STRIP = NO; 661 | GCC_DYNAMIC_NO_PIC = NO; 662 | GCC_ENABLE_FIX_AND_CONTINUE = YES; 663 | GCC_MODEL_TUNING = G5; 664 | GCC_OPTIMIZATION_LEVEL = 0; 665 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 666 | GCC_PREFIX_HEADER = JRSwizzleTest_Prefix.pch; 667 | INSTALL_PATH = /usr/local/bin; 668 | PRODUCT_NAME = JRSwizzleTest_1050_32; 669 | ZERO_LINK = YES; 670 | }; 671 | name = Debug; 672 | }; 673 | 1DEB927608733DD40010E9CD /* Release */ = { 674 | isa = XCBuildConfiguration; 675 | buildSettings = { 676 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 677 | GCC_MODEL_TUNING = G5; 678 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 679 | GCC_PREFIX_HEADER = JRSwizzleTest_Prefix.pch; 680 | INSTALL_PATH = /usr/local/bin; 681 | PRODUCT_NAME = JRSwizzleTest_1050_32; 682 | }; 683 | name = Release; 684 | }; 685 | 1DEB927908733DD40010E9CD /* Debug */ = { 686 | isa = XCBuildConfiguration; 687 | buildSettings = { 688 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 689 | GCC_WARN_UNUSED_VARIABLE = YES; 690 | PREBINDING = NO; 691 | SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk"; 692 | }; 693 | name = Debug; 694 | }; 695 | 1DEB927A08733DD40010E9CD /* Release */ = { 696 | isa = XCBuildConfiguration; 697 | buildSettings = { 698 | ARCHS = ( 699 | ppc, 700 | i386, 701 | ); 702 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 703 | GCC_WARN_UNUSED_VARIABLE = YES; 704 | PREBINDING = NO; 705 | SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk"; 706 | }; 707 | name = Release; 708 | }; 709 | 792607C50CF3F05800A93D12 /* Debug */ = { 710 | isa = XCBuildConfiguration; 711 | buildSettings = { 712 | COPY_PHASE_STRIP = NO; 713 | GCC_DYNAMIC_NO_PIC = NO; 714 | GCC_ENABLE_FIX_AND_CONTINUE = YES; 715 | GCC_MODEL_TUNING = G5; 716 | GCC_OPTIMIZATION_LEVEL = 0; 717 | INSTALL_PATH = /usr/local/bin; 718 | PREBINDING = NO; 719 | PRODUCT_NAME = JRSwizzleTest_1040; 720 | SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk"; 721 | ZERO_LINK = YES; 722 | }; 723 | name = Debug; 724 | }; 725 | 792607C60CF3F05800A93D12 /* Release */ = { 726 | isa = XCBuildConfiguration; 727 | buildSettings = { 728 | COPY_PHASE_STRIP = YES; 729 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 730 | GCC_ENABLE_FIX_AND_CONTINUE = NO; 731 | GCC_MODEL_TUNING = G5; 732 | INSTALL_PATH = /usr/local/bin; 733 | PREBINDING = NO; 734 | PRODUCT_NAME = JRSwizzleTest_1040; 735 | SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk"; 736 | ZERO_LINK = NO; 737 | }; 738 | name = Release; 739 | }; 740 | 792608570CF3F24400A93D12 /* Debug */ = { 741 | isa = XCBuildConfiguration; 742 | buildSettings = { 743 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/JRSwizzleTest_1040"; 744 | COPY_PHASE_STRIP = NO; 745 | FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; 746 | GCC_DYNAMIC_NO_PIC = NO; 747 | GCC_ENABLE_FIX_AND_CONTINUE = NO; 748 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 749 | GCC_MODEL_TUNING = G5; 750 | GCC_OPTIMIZATION_LEVEL = 0; 751 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 752 | GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Cocoa.framework/Headers/Cocoa.h"; 753 | INFOPLIST_FILE = "10.4 Test-Info.plist"; 754 | INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles"; 755 | OTHER_LDFLAGS = ( 756 | "-framework", 757 | Cocoa, 758 | "-framework", 759 | SenTestingKit, 760 | ); 761 | PREBINDING = NO; 762 | PRODUCT_NAME = "10.4 Test"; 763 | SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk"; 764 | TEST_HOST = "$(BUNDLE_LOADER)"; 765 | WRAPPER_EXTENSION = octest; 766 | }; 767 | name = Debug; 768 | }; 769 | 792608580CF3F24400A93D12 /* Release */ = { 770 | isa = XCBuildConfiguration; 771 | buildSettings = { 772 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/JRSwizzleTest_1040"; 773 | COPY_PHASE_STRIP = YES; 774 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 775 | FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; 776 | GCC_ENABLE_FIX_AND_CONTINUE = NO; 777 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 778 | GCC_MODEL_TUNING = G5; 779 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 780 | GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Cocoa.framework/Headers/Cocoa.h"; 781 | INFOPLIST_FILE = "10.4 Test-Info.plist"; 782 | INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles"; 783 | OTHER_LDFLAGS = ( 784 | "-framework", 785 | Cocoa, 786 | "-framework", 787 | SenTestingKit, 788 | ); 789 | PREBINDING = NO; 790 | PRODUCT_NAME = "10.4 Test"; 791 | SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk"; 792 | TEST_HOST = "$(BUNDLE_LOADER)"; 793 | WRAPPER_EXTENSION = octest; 794 | ZERO_LINK = NO; 795 | }; 796 | name = Release; 797 | }; 798 | 792608A50CF3F88500A93D12 /* Debug */ = { 799 | isa = XCBuildConfiguration; 800 | buildSettings = { 801 | ARCHS = ppc; 802 | COPY_PHASE_STRIP = NO; 803 | GCC_DYNAMIC_NO_PIC = NO; 804 | GCC_ENABLE_FIX_AND_CONTINUE = YES; 805 | GCC_MODEL_TUNING = G5; 806 | GCC_OPTIMIZATION_LEVEL = 0; 807 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 808 | GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; 809 | INSTALL_PATH = /usr/local/bin; 810 | PREBINDING = NO; 811 | PRODUCT_NAME = JRSwizzleTest_1030; 812 | SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.3.9.sdk"; 813 | VALID_ARCHS = ppc; 814 | ZERO_LINK = YES; 815 | }; 816 | name = Debug; 817 | }; 818 | 792608A60CF3F88500A93D12 /* Release */ = { 819 | isa = XCBuildConfiguration; 820 | buildSettings = { 821 | ARCHS = ppc; 822 | COPY_PHASE_STRIP = YES; 823 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 824 | GCC_ENABLE_FIX_AND_CONTINUE = NO; 825 | GCC_MODEL_TUNING = G5; 826 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 827 | GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; 828 | INSTALL_PATH = /usr/local/bin; 829 | PREBINDING = NO; 830 | PRODUCT_NAME = JRSwizzleTest_1030; 831 | SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.3.9.sdk"; 832 | VALID_ARCHS = ppc; 833 | ZERO_LINK = NO; 834 | }; 835 | name = Release; 836 | }; 837 | 792609410CF3F98E00A93D12 /* Debug */ = { 838 | isa = XCBuildConfiguration; 839 | buildSettings = { 840 | ARCHS = ppc; 841 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/JRSwizzleTest_1030"; 842 | COPY_PHASE_STRIP = NO; 843 | FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; 844 | GCC_DYNAMIC_NO_PIC = NO; 845 | GCC_ENABLE_FIX_AND_CONTINUE = NO; 846 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 847 | GCC_MODEL_TUNING = G5; 848 | GCC_OPTIMIZATION_LEVEL = 0; 849 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 850 | GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Cocoa.framework/Headers/Cocoa.h"; 851 | INFOPLIST_FILE = "10.3 Test-Info.plist"; 852 | INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles"; 853 | OTHER_LDFLAGS = ( 854 | "-framework", 855 | Cocoa, 856 | "-framework", 857 | SenTestingKit, 858 | ); 859 | PREBINDING = NO; 860 | PRODUCT_NAME = "10.3 Test"; 861 | SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.3.9.sdk"; 862 | TEST_HOST = "$(BUNDLE_LOADER)"; 863 | VALID_ARCHS = ppc; 864 | WRAPPER_EXTENSION = octest; 865 | }; 866 | name = Debug; 867 | }; 868 | 792609420CF3F98E00A93D12 /* Release */ = { 869 | isa = XCBuildConfiguration; 870 | buildSettings = { 871 | ARCHS = ppc; 872 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/JRSwizzleTest_1030"; 873 | COPY_PHASE_STRIP = YES; 874 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 875 | FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; 876 | GCC_ENABLE_FIX_AND_CONTINUE = NO; 877 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 878 | GCC_MODEL_TUNING = G5; 879 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 880 | GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Cocoa.framework/Headers/Cocoa.h"; 881 | INFOPLIST_FILE = "10.3 Test-Info.plist"; 882 | INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles"; 883 | OTHER_LDFLAGS = ( 884 | "-framework", 885 | Cocoa, 886 | "-framework", 887 | SenTestingKit, 888 | ); 889 | PREBINDING = NO; 890 | PRODUCT_NAME = "10.3 Test"; 891 | SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.3.9.sdk"; 892 | TEST_HOST = "$(BUNDLE_LOADER)"; 893 | VALID_ARCHS = ppc; 894 | WRAPPER_EXTENSION = octest; 895 | ZERO_LINK = NO; 896 | }; 897 | name = Release; 898 | }; 899 | 79F3DBEC0CF33E6000733703 /* Debug */ = { 900 | isa = XCBuildConfiguration; 901 | buildSettings = { 902 | COPY_PHASE_STRIP = NO; 903 | GCC_DYNAMIC_NO_PIC = NO; 904 | GCC_ENABLE_FIX_AND_CONTINUE = YES; 905 | GCC_MODEL_TUNING = G5; 906 | GCC_OPTIMIZATION_LEVEL = 0; 907 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 908 | GCC_PREFIX_HEADER = JRSwizzleTest_Prefix.pch; 909 | INSTALL_PATH = /usr/local/bin; 910 | PRODUCT_NAME = JRSwizzleTest_1050_64; 911 | ZERO_LINK = YES; 912 | }; 913 | name = Debug; 914 | }; 915 | 79F3DBED0CF33E6000733703 /* Release */ = { 916 | isa = XCBuildConfiguration; 917 | buildSettings = { 918 | ARCHS = ( 919 | ppc64, 920 | x86_64, 921 | ); 922 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 923 | GCC_MODEL_TUNING = G5; 924 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 925 | GCC_PREFIX_HEADER = JRSwizzleTest_Prefix.pch; 926 | INSTALL_PATH = /usr/local/bin; 927 | PRODUCT_NAME = JRSwizzleTest_1050_64; 928 | }; 929 | name = Release; 930 | }; 931 | 79F3DBFB0CF33EE500733703 /* Debug */ = { 932 | isa = XCBuildConfiguration; 933 | buildSettings = { 934 | COPY_PHASE_STRIP = NO; 935 | GCC_DYNAMIC_NO_PIC = NO; 936 | GCC_OPTIMIZATION_LEVEL = 0; 937 | PRODUCT_NAME = "All Tests"; 938 | }; 939 | name = Debug; 940 | }; 941 | 79F3DBFC0CF33EE500733703 /* Release */ = { 942 | isa = XCBuildConfiguration; 943 | buildSettings = { 944 | COPY_PHASE_STRIP = YES; 945 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 946 | GCC_ENABLE_FIX_AND_CONTINUE = NO; 947 | PRODUCT_NAME = "All Tests"; 948 | ZERO_LINK = NO; 949 | }; 950 | name = Release; 951 | }; 952 | 79F3DC170CF33F5100733703 /* Debug */ = { 953 | isa = XCBuildConfiguration; 954 | buildSettings = { 955 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/JRSwizzleTest_1050_32"; 956 | COPY_PHASE_STRIP = NO; 957 | FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; 958 | GCC_DYNAMIC_NO_PIC = NO; 959 | GCC_ENABLE_FIX_AND_CONTINUE = NO; 960 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 961 | GCC_MODEL_TUNING = G5; 962 | GCC_OPTIMIZATION_LEVEL = 0; 963 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 964 | GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Cocoa.framework/Headers/Cocoa.h"; 965 | INFOPLIST_FILE = "10.5 32-bit Test-Info.plist"; 966 | INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles"; 967 | OTHER_LDFLAGS = ( 968 | "-framework", 969 | Cocoa, 970 | "-framework", 971 | SenTestingKit, 972 | ); 973 | PREBINDING = NO; 974 | PRODUCT_NAME = "10.5 32-bit Test"; 975 | TEST_HOST = "$(BUNDLE_LOADER)"; 976 | WRAPPER_EXTENSION = octest; 977 | }; 978 | name = Debug; 979 | }; 980 | 79F3DC180CF33F5100733703 /* Release */ = { 981 | isa = XCBuildConfiguration; 982 | buildSettings = { 983 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/JRSwizzleTest_1050_32"; 984 | COPY_PHASE_STRIP = YES; 985 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 986 | FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; 987 | GCC_ENABLE_FIX_AND_CONTINUE = NO; 988 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 989 | GCC_MODEL_TUNING = G5; 990 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 991 | GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Cocoa.framework/Headers/Cocoa.h"; 992 | INFOPLIST_FILE = "10.5 32-bit Test-Info.plist"; 993 | INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles"; 994 | OTHER_LDFLAGS = ( 995 | "-framework", 996 | Cocoa, 997 | "-framework", 998 | SenTestingKit, 999 | ); 1000 | PREBINDING = NO; 1001 | PRODUCT_NAME = "10.5 32-bit Test"; 1002 | TEST_HOST = "$(BUNDLE_LOADER)"; 1003 | WRAPPER_EXTENSION = octest; 1004 | ZERO_LINK = NO; 1005 | }; 1006 | name = Release; 1007 | }; 1008 | 79F3DC2F0CF341EC00733703 /* Debug */ = { 1009 | isa = XCBuildConfiguration; 1010 | buildSettings = { 1011 | ARCHS = ( 1012 | ppc64, 1013 | x86_64, 1014 | ); 1015 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/JRSwizzleTest_1050_64"; 1016 | COPY_PHASE_STRIP = NO; 1017 | FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; 1018 | GCC_DYNAMIC_NO_PIC = NO; 1019 | GCC_ENABLE_FIX_AND_CONTINUE = NO; 1020 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 1021 | GCC_MODEL_TUNING = G5; 1022 | GCC_OPTIMIZATION_LEVEL = 0; 1023 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 1024 | GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Cocoa.framework/Headers/Cocoa.h"; 1025 | INFOPLIST_FILE = "10.5 64-bit Test-Info.plist"; 1026 | INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles"; 1027 | OTHER_LDFLAGS = ( 1028 | "-framework", 1029 | Cocoa, 1030 | "-framework", 1031 | SenTestingKit, 1032 | ); 1033 | PREBINDING = NO; 1034 | PRODUCT_NAME = "10.5 64-bit Test"; 1035 | TEST_HOST = "$(BUNDLE_LOADER)"; 1036 | WRAPPER_EXTENSION = octest; 1037 | }; 1038 | name = Debug; 1039 | }; 1040 | 79F3DC300CF341EC00733703 /* Release */ = { 1041 | isa = XCBuildConfiguration; 1042 | buildSettings = { 1043 | ARCHS = ( 1044 | ppc64, 1045 | x86_64, 1046 | ); 1047 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/JRSwizzleTest_1050_64"; 1048 | COPY_PHASE_STRIP = YES; 1049 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 1050 | FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; 1051 | GCC_ENABLE_FIX_AND_CONTINUE = NO; 1052 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 1053 | GCC_MODEL_TUNING = G5; 1054 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 1055 | GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Cocoa.framework/Headers/Cocoa.h"; 1056 | INFOPLIST_FILE = "10.5 64-bit Test-Info.plist"; 1057 | INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles"; 1058 | OTHER_LDFLAGS = ( 1059 | "-framework", 1060 | Cocoa, 1061 | "-framework", 1062 | SenTestingKit, 1063 | ); 1064 | PREBINDING = NO; 1065 | PRODUCT_NAME = "10.5 64-bit Test"; 1066 | TEST_HOST = "$(BUNDLE_LOADER)"; 1067 | WRAPPER_EXTENSION = octest; 1068 | ZERO_LINK = NO; 1069 | }; 1070 | name = Release; 1071 | }; 1072 | /* End XCBuildConfiguration section */ 1073 | 1074 | /* Begin XCConfigurationList section */ 1075 | 1DEB927408733DD40010E9CD /* Build configuration list for PBXNativeTarget "10.5 32-bit" */ = { 1076 | isa = XCConfigurationList; 1077 | buildConfigurations = ( 1078 | 1DEB927508733DD40010E9CD /* Debug */, 1079 | 1DEB927608733DD40010E9CD /* Release */, 1080 | ); 1081 | defaultConfigurationIsVisible = 0; 1082 | defaultConfigurationName = Release; 1083 | }; 1084 | 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "JRSwizzleTest" */ = { 1085 | isa = XCConfigurationList; 1086 | buildConfigurations = ( 1087 | 1DEB927908733DD40010E9CD /* Debug */, 1088 | 1DEB927A08733DD40010E9CD /* Release */, 1089 | ); 1090 | defaultConfigurationIsVisible = 0; 1091 | defaultConfigurationName = Release; 1092 | }; 1093 | 792607C70CF3F09500A93D12 /* Build configuration list for PBXNativeTarget "10.4" */ = { 1094 | isa = XCConfigurationList; 1095 | buildConfigurations = ( 1096 | 792607C50CF3F05800A93D12 /* Debug */, 1097 | 792607C60CF3F05800A93D12 /* Release */, 1098 | ); 1099 | defaultConfigurationIsVisible = 0; 1100 | defaultConfigurationName = Release; 1101 | }; 1102 | 792608590CF3F24400A93D12 /* Build configuration list for PBXNativeTarget "10.4 Test" */ = { 1103 | isa = XCConfigurationList; 1104 | buildConfigurations = ( 1105 | 792608570CF3F24400A93D12 /* Debug */, 1106 | 792608580CF3F24400A93D12 /* Release */, 1107 | ); 1108 | defaultConfigurationIsVisible = 0; 1109 | defaultConfigurationName = Release; 1110 | }; 1111 | 792608A70CF3F8AC00A93D12 /* Build configuration list for PBXNativeTarget "10.3" */ = { 1112 | isa = XCConfigurationList; 1113 | buildConfigurations = ( 1114 | 792608A50CF3F88500A93D12 /* Debug */, 1115 | 792608A60CF3F88500A93D12 /* Release */, 1116 | ); 1117 | defaultConfigurationIsVisible = 0; 1118 | defaultConfigurationName = Release; 1119 | }; 1120 | 792609430CF3F98E00A93D12 /* Build configuration list for PBXNativeTarget "10.3 Test" */ = { 1121 | isa = XCConfigurationList; 1122 | buildConfigurations = ( 1123 | 792609410CF3F98E00A93D12 /* Debug */, 1124 | 792609420CF3F98E00A93D12 /* Release */, 1125 | ); 1126 | defaultConfigurationIsVisible = 0; 1127 | defaultConfigurationName = Release; 1128 | }; 1129 | 79F3DBEB0CF33E6000733703 /* Build configuration list for PBXNativeTarget "10.5 64-bit" */ = { 1130 | isa = XCConfigurationList; 1131 | buildConfigurations = ( 1132 | 79F3DBEC0CF33E6000733703 /* Debug */, 1133 | 79F3DBED0CF33E6000733703 /* Release */, 1134 | ); 1135 | defaultConfigurationIsVisible = 0; 1136 | defaultConfigurationName = Release; 1137 | }; 1138 | 79F3DC0C0CF33EFB00733703 /* Build configuration list for PBXAggregateTarget "All Tests" */ = { 1139 | isa = XCConfigurationList; 1140 | buildConfigurations = ( 1141 | 79F3DBFB0CF33EE500733703 /* Debug */, 1142 | 79F3DBFC0CF33EE500733703 /* Release */, 1143 | ); 1144 | defaultConfigurationIsVisible = 0; 1145 | defaultConfigurationName = Release; 1146 | }; 1147 | 79F3DC190CF33F5100733703 /* Build configuration list for PBXNativeTarget "10.5 32-bit Test" */ = { 1148 | isa = XCConfigurationList; 1149 | buildConfigurations = ( 1150 | 79F3DC170CF33F5100733703 /* Debug */, 1151 | 79F3DC180CF33F5100733703 /* Release */, 1152 | ); 1153 | defaultConfigurationIsVisible = 0; 1154 | defaultConfigurationName = Release; 1155 | }; 1156 | 79F3DC310CF341EC00733703 /* Build configuration list for PBXNativeTarget "10.5 64-bit Test" */ = { 1157 | isa = XCConfigurationList; 1158 | buildConfigurations = ( 1159 | 79F3DC2F0CF341EC00733703 /* Debug */, 1160 | 79F3DC300CF341EC00733703 /* Release */, 1161 | ); 1162 | defaultConfigurationIsVisible = 0; 1163 | defaultConfigurationName = Release; 1164 | }; 1165 | /* End XCConfigurationList section */ 1166 | }; 1167 | rootObject = 08FB7793FE84155DC02AAC07 /* Project object */; 1168 | } 1169 | -------------------------------------------------------------------------------- /JRSwizzleTest/JRSwizzleTest_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'JRSwizzleTest' target in the 'JRSwizzleTest' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /JRSwizzleTest/MethodSwizzle.h: -------------------------------------------------------------------------------- 1 | // 2 | // MethodSwizzle.h 3 | // 4 | // Copyright (c) 2006 Tildesoft. All rights reserved. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a 7 | // copy of this software and associated documentation files (the "Software"), 8 | // to deal in the Software without restriction, including without limitation 9 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 10 | // and/or sell copies of the Software, and to permit persons to whom the 11 | // Software is furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22 | // DEALINGS IN THE SOFTWARE. 23 | 24 | #import 25 | 26 | BOOL ClassMethodSwizzle(Class klass, SEL origSel, SEL altSel); 27 | BOOL MethodSwizzle(Class klass, SEL origSel, SEL altSel); 28 | -------------------------------------------------------------------------------- /JRSwizzleTest/MethodSwizzle.m: -------------------------------------------------------------------------------- 1 | // 2 | // MethodSwizzle.m 3 | // 4 | // Copyright (c) 2006 Tildesoft. All rights reserved. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a 7 | // copy of this software and associated documentation files (the "Software"), 8 | // to deal in the Software without restriction, including without limitation 9 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 10 | // and/or sell copies of the Software, and to permit persons to whom the 11 | // Software is furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22 | // DEALINGS IN THE SOFTWARE. 23 | 24 | // Implementation of Method Swizzling, inspired by 25 | // http://www.cocoadev.com/index.pl?MethodSwizzling 26 | 27 | // solves the inherited method problem 28 | 29 | #import "MethodSwizzle.h" 30 | #import 31 | #import 32 | #import 33 | #import 34 | 35 | static BOOL _PerformSwizzle(Class klass, SEL origSel, SEL altSel, BOOL forInstance); 36 | 37 | BOOL ClassMethodSwizzle(Class klass, SEL origSel, SEL altSel) { 38 | return _PerformSwizzle(klass, origSel, altSel, NO); 39 | } 40 | 41 | BOOL MethodSwizzle(Class klass, SEL origSel, SEL altSel) { 42 | return _PerformSwizzle(klass, origSel, altSel, YES); 43 | } 44 | 45 | // if the origSel isn't present in the class, pull it up from where it exists 46 | // then do the swizzle 47 | BOOL _PerformSwizzle(Class klass, SEL origSel, SEL altSel, BOOL forInstance) { 48 | // First, make sure the class isn't nil 49 | if (klass != nil) { 50 | Method origMethod = NULL, altMethod = NULL; 51 | 52 | // Next, look for the methods 53 | Class iterKlass = (forInstance ? klass : klass->isa); 54 | void *iterator = NULL; 55 | struct objc_method_list *mlist = class_nextMethodList(iterKlass, &iterator); 56 | while (mlist != NULL) { 57 | int i; 58 | for (i = 0; i < mlist->method_count; ++i) { 59 | if (mlist->method_list[i].method_name == origSel) { 60 | origMethod = &mlist->method_list[i]; 61 | break; 62 | } 63 | if (mlist->method_list[i].method_name == altSel) { 64 | altMethod = &mlist->method_list[i]; 65 | break; 66 | } 67 | } 68 | mlist = class_nextMethodList(iterKlass, &iterator); 69 | } 70 | 71 | if (origMethod == NULL || altMethod == NULL) { 72 | // one or both methods are not in the immediate class 73 | // try searching the entire hierarchy 74 | // remember, iterKlass is the class we care about - klass || klass->isa 75 | // class_getInstanceMethod on a metaclass is the same as class_getClassMethod on the real class 76 | BOOL pullOrig = NO, pullAlt = NO; 77 | if (origMethod == NULL) { 78 | origMethod = class_getInstanceMethod(iterKlass, origSel); 79 | pullOrig = YES; 80 | } 81 | if (altMethod == NULL) { 82 | altMethod = class_getInstanceMethod(iterKlass, altSel); 83 | pullAlt = YES; 84 | } 85 | 86 | // die now if one of the methods doesn't exist anywhere in the hierarchy 87 | // this way we won't make any changes to the class if we can't finish 88 | if (origMethod == NULL || altMethod == NULL) { 89 | return NO; 90 | } 91 | 92 | // we can safely assume one of the two methods, at least, will be pulled 93 | // pull them up 94 | size_t listSize = sizeof(struct objc_method_list); 95 | if (pullOrig && pullAlt) listSize += sizeof(struct objc_method); // need 2 methods 96 | struct objc_method_list *mlist = malloc(listSize); 97 | mlist->obsolete = NULL; 98 | int i = 0; 99 | if (pullOrig) { 100 | memcpy(&mlist->method_list[i], origMethod, sizeof(struct objc_method)); 101 | origMethod = &mlist->method_list[i]; 102 | i++; 103 | } 104 | if (pullAlt) { 105 | memcpy(&mlist->method_list[i], altMethod, sizeof(struct objc_method)); 106 | altMethod = &mlist->method_list[i]; 107 | i++; 108 | } 109 | mlist->method_count = i; 110 | class_addMethods(iterKlass, mlist); 111 | } 112 | 113 | // now swizzle 114 | IMP temp = origMethod->method_imp; 115 | origMethod->method_imp = altMethod->method_imp; 116 | altMethod->method_imp = temp; 117 | 118 | return YES; 119 | } 120 | return NO; 121 | } 122 | -------------------------------------------------------------------------------- /JRSwizzleTest/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #if 0 4 | 5 | Scenario Swizzle Technology Method Implementation Correct Behavior 10.4 64-bit 6 | ======== ================================ ===================== ================ ==== ====== 7 | 1 Classic Direct YES YES NO 8 | 2 Classic Inherited NO YES NO 9 | 3 Ballard Direct YES YES NO 10 | 4 Ballard Inherited YES YES NO 11 | 5 method_exchangeImplementations Direct YES NO YES 12 | 6 method_exchangeImplementations Inherited NO NO YES 13 | 7 +swizzleMethod:withMethod:error: Direct YES YES YES 14 | 8 +swizzleMethod:withMethod:error: Inherited YES YES YES 15 | 16 | * build+test 10.3 ppc (1, 2, 3, 4, 7, 8) 17 | * build+test 10.4 ppc + i386 (1, 2, 3, 4, 7, 8) 18 | * build+test 10.5 32-bit ppc + i386 (1, 2, 3, 4, 5, 6, 7, 8) 19 | * build+test 10.5 64-bit x86_64 + ppc64 (5, 6, 7, 8) 20 | 21 | #endif 22 | 23 | int main (int argc, const char * argv[]) { 24 | BOOL sixty_four_bit; 25 | #ifdef __LP64__ 26 | sixty_four_bit = YES; 27 | #else 28 | sixty_four_bit = NO; 29 | #endif 30 | 31 | printf("JRSwizzleTest success SDK:%d %s\n", MAC_OS_X_VERSION_MAX_ALLOWED, sixty_four_bit ? "64-bit" : "32-bit"); 32 | return 0; 33 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2007-2016 Jonathan 'Wolf' Rentzsch 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | # JRSwizzle 2 | 3 | ## Description 4 | 5 | JRSwizzle is source code package that offers a single, easy, correct+consistent interface for exchanging Objective-C method implementations ("method swizzling") across many versions of Mac OS X, iOS, Objective-C and runtime architectures. 6 | 7 | More succinctly: *JRSwizzle wants to be your one-stop-shop for all your method swizzling needs.* 8 | 9 | ## Download 10 | 11 | $ cd /path/to/top/of/your/project 12 | $ git submodule add git://github.com/rentzsch/jrswizzle.git JRSwizzle semver-1.x 13 | $ git submodule init && git submodule update 14 | 15 | # OPTIONAL: Execute the following commands if you want to explicitly peg 16 | # to a certain version. Otherwise `git submodule update` will keep you 17 | # current with HEAD. 18 | 19 | $ cd JRSwizzle 20 | $ git checkout v1.1.0 21 | 22 | ## Reasons for Existence 23 | 24 | * **Easy:** Just do this: `[SomeClass jr_swizzle:@selector(foo) withMethod:@selector(my_foo) error:&error];` Voila. 25 | * **Correct:** There's a subtle interaction between method swizzling and method inheritance. Following in Kevin Ballard's footsteps, this package Does The Right Thing. 26 | * **Compatible:** JRSwizzle should Just Work on any version of Mac OS X and iOS you care about. Here's the exhaustive compatibility list: 27 | * Mac OS X v10.3/ppc (Ballard implementation) 28 | * Mac OS X v10.4/ppc (Ballard implementation) 29 | * Mac OS X v10.4/i386 (Ballard implementation) 30 | * Mac OS X v10.5/ppc (method_exchangeImplementations+Ballard implementation) 31 | * Mac OS X v10.5/i386 (method_exchangeImplementations+Ballard implementation) 32 | * Mac OS X v10.5/ppc64 (method_exchangeImplementations+Ballard implementation) 33 | * Mac OS X v10.5/x86_64 (method_exchangeImplementations+Ballard implementation) 34 | * iOS 2.0+ (method_exchangeImplementations+Ballard implementation) 35 | * **Robust:** All parameters are checked and JRSwizzle returns an optional `NSError` with high-quality diagnostics. 36 | 37 | ## Support 38 | 39 | Please use [JRSwizzle's GitHub Issues tab](https://github.com/rentzsch/jrswizzle/issues) to [file bugs or feature requests](https://github.com/rentzsch/jrswizzle/issues/new). 40 | 41 | To contribute, please fork this project, make+commit your changes and then send me a pull request. 42 | 43 | ## Comparison 44 | 45 | There's at least four swizzling implementations floating around. Here's a comparison chart to help you make sense of how they relate to each other and why JRSwizzle exists. 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 |
ScenarioSwizzle TechnologyMethod ImplementationCorrect Behavior10.464-bit
1ClassicDirectYESYESNO
2ClassicInheritedNOYESNO
3BallardDirectYESYESNO
4BallardInheritedYESYESNO
5AppleDirectYESNOYES
6AppleInheritedNONOYES
7JRSwizzleDirectYESYESYES
8JRSwizzleInheritedYESYESYES
121 | 122 | * *Classic* is the canonical `MethodSwizzle()` implementation as described in [CocoaDev's MethodSwizzling page](http://cocoadev.com/MethodSwizzling). 123 | * *Ballard* is [Kevin Ballard's improved implementation](http://kevin.sb.org/2006/12/30/method-swizzling-reimplemented/) which solves the inherited method problem. 124 | * *Apple* is 10.5's new `method_exchangeImplementations` API. 125 | * *JRSwizzle* is this package. 126 | 127 | ## License 128 | 129 | The source code is distributed under the nonviral [MIT License](http://opensource.org/licenses/mit-license.php). It's the simplest most permissive license available. 130 | 131 | ## Version History 132 | 133 | * **v1.1.0:** Nov 28 2016 134 | 135 | * [NEW] Block-based swizzle api. Note it uses `NSInvocation` which is known to be not the fastest of APIs. ([dhcdht](https://github.com/rentzsch/jrswizzle/pull/18)) 136 | 137 | * **v1.0:** Mar 2 2012 138 | 139 | * [NEW] iOS Support. ([Anton Serebryakov](https://github.com/rentzsch/jrswizzle/commit/60ccb350a3577e55d00d3fdfee8b3c0390b8e852])) 140 | 141 | * [NEW] Class method swizzling. ([outis](https://github.com/rentzsch/jrswizzle/pull/1)) 142 | 143 | * **v1.0d1:** May 31 2009 144 | 145 | * [FIX] Soothe valgrind by nulling out `hoisted_method_list->obsolete`, which it apparently reads. ([Daniel Jalkut](http://github.com/rentzsch/jrswizzle/commit/2f677d063202b443ca7a1c46e8b67d67ea6fc88e)) 146 | 147 | * [FIX] Xcode 3.2 apparently now needs `ARCHS` set explicitly for 10.3 targets. ([rentzsch](http://github.com/rentzsch/jrswizzle/commit/4478faa40e4fdb322201da20f24d3996193ea48b)) 148 | 149 | * **v1.0d0:** Apr 09 2009 150 | 151 | * Moved to github. 152 | 153 | * **v1.0d0:** Dec 28 2007 154 | 155 | * Under development. 156 | --------------------------------------------------------------------------------