From a2e257158f491a0428926d0bf99e9200d3e0617f Mon Sep 17 00:00:00 2001 From: "gtm.daemon" Date: Mon, 22 Mar 2010 18:05:14 +0000 Subject: [Author: dmaclach] Added some KVO debugging help. Specifically forces can access instance variables by KVO to NO in debug mode. R=thomasvl DELTA=340 (269 added, 21 deleted, 50 changed) --- Foundation/GTMNSObject+KeyValueObserving.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Foundation/GTMNSObject+KeyValueObserving.h') diff --git a/Foundation/GTMNSObject+KeyValueObserving.h b/Foundation/GTMNSObject+KeyValueObserving.h index de11aeb..079717f 100644 --- a/Foundation/GTMNSObject+KeyValueObserving.h +++ b/Foundation/GTMNSObject+KeyValueObserving.h @@ -32,6 +32,12 @@ #import +#ifndef GTM_PERFORM_KVO_CHECKS +// Controls whether KVO checking code is on in debug. See +// GTMNSObject+KeyValueObserving.m for details +#define GTM_PERFORM_KVO_CHECKS 1 +#endif + // If you read the articles above you will see that doing KVO correctly // is actually pretty tricky, and that Apple's documentation may not be // completely clear as to how things should be used. Use the methods below @@ -51,6 +57,10 @@ - (void)gtm_removeObserver:(id)observer forKeyPath:(NSString *)keyPath selector:(SEL)selector; + +// Use this to have |self| stop observing all keypaths on all objects. +- (void)gtm_stopObservingAllKeyPaths; + @end // This is the class that is sent to your notification selector as an -- cgit v1.2.3