Returns a set of key paths for properties whose values affect the value of the specified key.
- iOS 2.0+
- macOS 10.5+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
The key whose value is affected by the key paths.
When an observer for the key is registered with an instance of the receiving class, key-value observing itself automatically observes all of the key paths for the same instance, and sends change notifications for the key to the observer when the value for any of those key paths changes.
The default implementation of this method searches the receiving class for a method whose name matches the pattern
+key, and returns the result of invoking that method if it is found. Any such method must return an NSSet. If no such method is found, an NSSet that is computed from information provided by previous invocations of the now-deprecated
set method is returned, for backward binary compatibility.
You can override this method when the getter method of one of your properties computes a value to return using the values of other properties, including those that are located by key paths. Your override should typically call
super and return a set that includes any members in the set that result from doing that (so as not to interfere with overrides of this method in superclasses).