diff options
author | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2010-03-24 00:00:55 +0000 |
---|---|---|
committer | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2010-03-24 00:00:55 +0000 |
commit | 45c5610623e56e29cde7dd1f942973bbbbf6b3f9 (patch) | |
tree | 38e5e46fd422bdc3d7b91a56028cba50afe7a8da /Foundation/GTMNSObject+KeyValueObserving.m | |
parent | a2e257158f491a0428926d0bf99e9200d3e0617f (diff) |
[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)
Diffstat (limited to 'Foundation/GTMNSObject+KeyValueObserving.m')
-rw-r--r-- | Foundation/GTMNSObject+KeyValueObserving.m | 10 |
1 files changed, 10 insertions, 0 deletions
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]; |