Share via


NSManagedObjectContext.Notifications.ObserveDidSaveObjectIds Method

Definition

Overloads

ObserveDidSaveObjectIds(EventHandler<NSManagedObjectsIdsChangedEventArgs>)

Strongly typed notification for the DidSaveObjectIdsNotification constant.

public static Foundation.NSObject ObserveDidSaveObjectIds(EventHandler<CoreData.NSManagedObjectsIdsChangedEventArgs> handler);
static member ObserveDidSaveObjectIds : EventHandler<CoreData.NSManagedObjectsIdsChangedEventArgs> -> Foundation.NSObject

Parameters

handler
EventHandler<NSManagedObjectsIdsChangedEventArgs>

The handler that responds to the notification when it occurs.

Returns

Token object that can be used to stop receiving notifications by either disposing it or passing it to RemoveObservers(IEnumerable<NSObject>).

Remarks

This method can be used to subscribe to DidSaveObjectIdsNotification notifications.

// Listen to all notifications posted for any object
var token = NSManagedObjectContext.Notifications.ObserveDidSaveObjectIds ((notification) => {
  Console.WriteLine ("Observed DidSaveObjectIdsNotification!");
};

// Stop listening for notifications
token.Dispose ();

Applies to

ObserveDidSaveObjectIds(NSObject, EventHandler<NSManagedObjectsIdsChangedEventArgs>)

Strongly typed notification for the DidSaveObjectIdsNotification constant.

public static Foundation.NSObject ObserveDidSaveObjectIds(Foundation.NSObject objectToObserve, EventHandler<CoreData.NSManagedObjectsIdsChangedEventArgs> handler);
static member ObserveDidSaveObjectIds : Foundation.NSObject * EventHandler<CoreData.NSManagedObjectsIdsChangedEventArgs> -> Foundation.NSObject

Parameters

objectToObserve
NSObject

The specific object to observe.

handler
EventHandler<NSManagedObjectsIdsChangedEventArgs>

The handler that responds to the notification when it occurs.

Returns

Token object that can be used to stop receiving notifications by either disposing it or passing it to RemoveObservers(IEnumerable<NSObject>).

Remarks

This method can be used to subscribe to DidSaveObjectIdsNotification notifications.

// Listen to all notifications posted for a single object
var token = NSManagedObjectContext.Notifications.ObserveDidSaveObjectIds (objectToObserve, (notification) => {
  Console.WriteLine ($"Observed DidSaveObjectIdsNotification for {nameof (objectToObserve)}!");
};

// Stop listening for notifications
token.Dispose ();

Applies to