From 45c5610623e56e29cde7dd1f942973bbbbf6b3f9 Mon Sep 17 00:00:00 2001 From: "gtm.daemon" Date: Wed, 24 Mar 2010 00:00:55 +0000 Subject: [Author: dmaclach] Fix up QSB so it will launch on SnowLeopard properly when prefs are deleted. R=mrossetti DELTA=14 (14 added, 0 deleted, 0 changed) --- Foundation/GTMNSObject+KeyValueObserving.m | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Foundation/GTMNSObject+KeyValueObserving.m') diff --git a/Foundation/GTMNSObject+KeyValueObserving.m b/Foundation/GTMNSObject+KeyValueObserving.m index dde77e5..9247082 100644 --- a/Foundation/GTMNSObject+KeyValueObserving.m +++ b/Foundation/GTMNSObject+KeyValueObserving.m @@ -411,12 +411,17 @@ static void SwizzleMethodsInClass(Class cls, SEL sel1, SEL sel2) { method_exchangeImplementations(m1, m2); } +#if GTM_PERFORM_KVO_CHECKS + +// This is only used when GTM_PERFORM_KVO_CHECKS is on. static void SwizzleClassMethodsInClass(Class cls, SEL sel1, SEL sel2) { Method m1 = class_getClassMethod(cls, sel1); Method m2 = class_getClassMethod(cls, sel2); method_exchangeImplementations(m1, m2); } +#endif // GTM_PERFORM_KVO_CHECKS + // This category exists to attempt to help deal with tricky KVO issues. // KVO is a wonderful technology in some ways, but is extremely fragile and // allows developers a lot of freedom to shoot themselves in the foot. @@ -474,6 +479,9 @@ GTM_METHOD_CHECK(NSArray, _gtmDebugArrayAddObserver:toObjectsAtIndexes:forKeyPath:options:context:); GTM_METHOD_CHECK(NSArray, _gtmDebugArrayRemoveObserver:fromObjectsAtIndexes:forKeyPath:); + +#if GTM_PERFORM_KVO_CHECKS + GTM_METHOD_CHECK(NSObject, _gtmCheckAddObserver:forKeyPath:options:context:); GTM_METHOD_CHECK(NSArray, @@ -481,6 +489,8 @@ GTM_METHOD_CHECK(NSArray, GTM_METHOD_CHECK(NSObject, _gtmAccessInstanceVariablesDirectly); +#endif // GTM_PERFORM_KVO_CHECKS + + (void)load { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSDictionary *env = [[NSProcessInfo processInfo] environment]; -- cgit v1.2.3