MonobjcMonobjc Documented Class Library
NSKeyValueObservingOptions Enumeration
NamespacesMonobjc.FoundationNSKeyValueObservingOptions

These constants are passed to addObserver:forKeyPath:options:context: and determine the values that are returned as part of the change dictionary passed to an observeValueForKeyPath:ofObject:change:context:. You can pass 0 if you require no change dictionary values.

Available in Mac OS X v10.3 and later.

Declaration Syntax
C#Visual BasicVisual C++
public enum NSKeyValueObservingOptions
Public Enumeration NSKeyValueObservingOptions
public enum class NSKeyValueObservingOptions
Members
MemberDescription
NSKeyValueObservingOptionNew

Indicates that the change dictionary should provide the new attribute value, if applicable.

Available in Mac OS X v10.3 and later.


NSKeyValueObservingOptionOld

Indicates that the change dictionary should contain the old attribute value, if applicable.

Available in Mac OS X v10.3 and later.


NSKeyValueObservingOptionInitial

If specified, a notification should be sent to the observer immediately, before the observer registration method even returns.

The change dictionary in the notification will always contain an NSKeyValueChangeNewKey entry if NSKeyValueObservingOptionNew is also specified but will never contain an NSKeyValueChangeOldKey entry. (In an initial notification the current value of the observed property may be old, but it's new to the observer.) You can use this option instead of explicitly invoking, at the same time, code that is also invoked by the observer's observeValueForKeyPath:ofObject:change:context: method. When this option is used withaddObserver:forKeyPath:options:context: a notification will be sent for each indexed object to which the observer is being added.

Available in Mac OS X v10.5 and later.


NSKeyValueObservingOptionPrior

Whether separate notifications should be sent to the observer before and after each change, instead of a single notification after the change.

The change dictionary in a notification sent before a change always contains an NSKeyValueChangeNotificationIsPriorKey entry whose value is [NSNumber numberWithBool:YES], but never contains an NSKeyValueChangeNewKey entry. When this option is specified the change dictionary in a notification sent after a change contains the same entries that it would contain if this option were not specified. You can use this option when the observer's own key-value observing-compliance requires it to invoke one of the -willChange... methods for one of its own properties, and the value of that property depends on the value of the observed object's property. (In that situation it's too late to easily invoke -willChange... properly in response to receiving an observeValueForKeyPath:ofObject:change:context: message after the change.)

Available in Mac OS X v10.5 and later.


Version Information
  • Available in Monobjc Bridge: 10.6 (For Mac OS X 10.6 and later), 10.5 (For Mac OS X 10.5 and later)

Assembly: Monobjc.Foundation (Module: Monobjc.Foundation)