This is currently not supported in GNUstep, but there’s an open pull request 
that implements this and various other improvements for KVO:
https://github.com/gnustep/libs-base/pull/420

Frederik


> Am 02.10.2024 um 15:42 schrieb Sebastian Reitenbach 
> <[email protected]>:
> Hi,
> 
> I'd like to observer a number of computed @properties in a class. For that 
> would like to use +keyPathsForValuesAffectingValueForKey:
> 
> Or alternatively using a number of keyPathsForValuesAffectingMyPropertyName 
> methods.
> 
> as explained here: 
> https://developer.apple.com/documentation/objectivec/nsobject/1414299-keypathsforvaluesaffectingvaluef
> 
> Whatever I do, the +keyPathsForValuesAffectingValueForKey or 
> keyPathsForValuesAffectingMyPropertyName methods never seem to get called by 
> my code.
> 
> In gnustep-base/Source/NSKeyValueObserving.m I see an implementation of 
> +keyPathsForValuesAffectingValueForKey: but don't see, from where that is 
> ever called?
> 
> I created a simple test tool demonstrating my issue here: 
> https://github.com/buzzdeee/TestObserver
> 
> As I understand the docs, this should just work "magically" by the KVO 
> implementation, or am I missing something?
> Any hints appreciated.
> 
> thanks,
> Sebastian

Reply via email to