From d2f3ceaf678b320e52a4d4da1facd8e9557b874f Mon Sep 17 00:00:00 2001 From: Alexander Ljungberg Date: Tue, 27 Mar 2012 23:45:18 +0100 Subject: [PATCH] Documentation. --- Foundation/CPKeyValueObserving.j | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Foundation/CPKeyValueObserving.j b/Foundation/CPKeyValueObserving.j index c05d791d9..8eebe7a29 100644 --- a/Foundation/CPKeyValueObserving.j +++ b/Foundation/CPKeyValueObserving.j @@ -69,6 +69,16 @@ [self[KVOProxyKey] _removeObserver:anObserver forKeyPath:aPath]; } +/*! + Whether -willChangeValueForKey/-didChangeValueForKey should automatically be invoked when the + setter of the given key is used. The default is YES. If you override this method to return NO + for some key, you will need to call -willChangeValueForKey/-didChangeValueForKey manually to + be KVO compliant. + + The default implementation of this method will check if the receiving class implements + `+ (BOOL)automaticallyNotifiesObserversOf` and return the response of that method if it + exists. +*/ + (BOOL)automaticallyNotifiesObserversForKey:(CPString)aKey { var capitalizedKey = aKey.charAt(0).toUpperCase() + aKey.substring(1),