MonoMac.Foundation.NSNotificationCenter.AddObserver Method
Adds an observer for the specified notification

Syntax

[System.Obsolete("Use AddObserver(NSString, Action<NSNotification>, NSObject)")]
public NSObject AddObserver (string aName, Action<NSNotification> notify, NSObject fromObject)

Parameters

aName
The name of the notification to observe.
notify
The delegate that will be invoked when the notification is posted.
fromObject
If not-null, filters the notifications to those sent by this object.

Returns

An observer token that can be used later as the parameter passed to RemoveObserver (NSObject observer).

Remarks

Use this overload if you are using a C# string. Usually you would be using an NSString constant using the pattern ClassName.SomeNotification.

Requirements

Namespace: MonoMac.Foundation
Assembly: XamMac (in XamMac.dll)
Assembly Versions: 0.0.0.0