共用方式為


NSHttpCookieStorage.AcceptPolicyChangedNotification 屬性

定義

AcceptPolicyChanged 的通知常數

[Foundation.Advice("Use NSHttpCookieStorage.Notifications.ObserveAcceptPolicyChanged helper method instead.")]
[Foundation.Field("NSHTTPCookieManagerCookiesChangedNotification", "Foundation")]
public static Foundation.NSString AcceptPolicyChangedNotification { get; }
member this.AcceptPolicyChangedNotification : Foundation.NSString

屬性值

NSString 常數應作為 NSNotificationCenter 的權杖使用。

屬性

備註

這個常數可以與 搭配 NSNotificationCenter 使用,以註冊此通知的接聽程式。 這是 NSString 而不是字串,因為這些值可以當做某些原生程式庫中的標記使用,而不是單純用於其實際字串內容。 回呼的 'notification' 參數包含通知類型特有的額外資訊。

// Lambda style
NSNotificationCenter.DefaultCenter.AddObserver (
        NSHttpCookieStorage.AcceptPolicyChangedNotification, (notification) => {Console.WriteLine ("Received the notification NSHttpCookieStorage", notification); }


// Method style
void Callback (NSNotification notification)
{
    Console.WriteLine ("Received a notification NSHttpCookieStorage", notification);
}

void Setup ()
{
    NSNotificationCenter.DefaultCenter.AddObserver (NSHttpCookieStorage.AcceptPolicyChangedNotification, Callback);
}

適用於