From c1f759ee56050fddf3e02c4fdd95134e374a0a50 Mon Sep 17 00:00:00 2001 From: P3PPP Date: Sat, 30 Jun 2018 05:27:53 +0900 Subject: [PATCH] Fix NSDistributedNotificationCenter.DefaultCenter return value - As we can't change NSDistributedNotificationCenter.DefaultCenter return value outside of XAMCORE_4_0 add NSDistributedNotificationCenter.GetDefaultCenter () and point people to that for now. - Fixed in XAMCORE_4_0 without the hack --- src/foundation.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/foundation.cs b/src/foundation.cs index a9398bb6ee..fbe115fe22 100644 --- a/src/foundation.cs +++ b/src/foundation.cs @@ -10255,7 +10255,15 @@ namespace Foundation interface NSDistributedNotificationCenter { [Static] [Export ("defaultCenter")] +#if XAMCORE_4_0 + NSDistributedNotificationCenter DefaultCenter { get; } +#else + NSDistributedNotificationCenter GetDefaultCenter (); + + [Advice ("Use 'GetDefaultCenter ()' for a strongly typed version.")] + [Wrap ("GetDefaultCenter ()", IsVirtual = true)] NSObject DefaultCenter { get; } +#endif [Export ("addObserver:selector:name:object:suspensionBehavior:")] void AddObserver (NSObject observer, Selector selector, [NullAllowed] string notificationName, [NullAllowed] string notificationSenderc, NSNotificationSuspensionBehavior suspensionBehavior);