< Previous PageNext Page > Hide TOC

Deprecated NSKeyValueObserving Methods

A method identified as deprecated has been superseded and may become unsupported in the future.

Deprecated in Mac OS X v10.5 and later

setKeys:triggerChangeNotificationsForDependentKey:

Configures the receiver to post change notifications for a given property if any of the properties specified in a given array changes. (Deprecated in Mac OS X v10.5 and later. You should use the method keyPathsForValuesAffectingValueForKey: instead.)

+ (void)setKeys:(NSArray *)keys triggerChangeNotificationsForDependentKey:(NSString *)dependentKey

Parameters
keys

The names of the properties upon which the value of the property identified by dependentKey depends.

dependentKey

The name of a property whose value depends on the properties specified by keys.

Discussion

Invocations of will- and did-change KVO notification methods for any key in keys will automatically invoke the corresponding change notification methods for dependentKey. The receiver will not receive willChange/didChange messages to generate the notifications.

Dependencies should be registered before any instances of the receiving class are created, so you typically invoke this method in a class's initialize method, as illustrated in the following example.

+ (void)initialize
{
    [self setKeys:[NSArray arrayWithObjects:@"firstName", @"lastName", nil]
          triggerChangeNotificationsForDependentKey:@"fullName"];
}
Availability
Related Sample Code
Declared In
NSKeyValueObserving.h

< Previous PageNext Page > Hide TOC


© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-10-31)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.