- observer
- The object that will receive the notifications. The object will receive notifications on its NSObject.ObserveValue method.
- keyPath
- Key-path to use to perform the value lookup. The keypath consists of a series of lowercase ASCII-strings with no spaces in them separated by dot characters.
- options
- Flags indicating which notifications you are interested in receiving (New, Old, Initial, Prior).
- context
- Context data passed to the NSObject.ObserveValue method when one of the properties change.
When the object is registered for observation, changes to the object specified in the keyPath that match the flags requested in options will be sent to the NSObject.ObserveValue method in the observer object.
To stop receiving notifications, call the NSObject.RemoveObserver method.
c# Example
class MySampleViewController : UIViewController { void Setup () { Player.AddObserver (this, (NSString)"rate", NSKeyValueObservingOptions.Old | NSKeyValueObservingOptions.New, IntPtr.Zero); } public override void ObserveValue (NSString keyPath, NSObject ofObject, NSDictionary change, IntPtr ctx) { // Handle change. } }