Instance Method

willChangeValueForKey:

Informs the observed object that the value of a given property is about to change.

Declaration

- (void)willChangeValueForKey:(NSString *)key;

Parameters

key

The name of the property that will change.

Discussion

Use this method when implementing key-value observer compliance manually to inform the observed object that the value at key is about to change.

The change type of this method is NSKeyValueChangeSetting.

Special Considerations

You rarely need to override this method in subclasses, but if you do, be sure to call super.

See Also

Notifying Observers of Changes

- didChangeValueForKey:

Informs the observed object that the value of a given property has changed.

- willChange:valuesAtIndexes:forKey:

Informs the observed object that the specified change is about to be executed at given indexes for a specified ordered to-many relationship.

- didChange:valuesAtIndexes:forKey:

Informs the observed object that the specified change has occurred on the indexes for a specified ordered to-many relationship.

- willChangeValueForKey:withSetMutation:usingObjects:

Informs the observed object that the specified change is about to be made to a specified unordered to-many relationship.

- didChangeValueForKey:withSetMutation:usingObjects:

Informs the observed object that the specified change was made to a specified unordered to-many relationship.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software