Bagikan melalui


CNContactStore.NotificationDidChange Properti

Definisi

Konstanta pemberitahuan untuk Notificat

[Foundation.Advice("Use CNContactStore.Notifications.ObserveNotificationDidChange helper method instead.")]
[Foundation.Field("CNContactStoreDidChangeNotification", "Contacts")]
public static Foundation.NSString NotificationDidChange { get; }
member this.NotificationDidChange : Foundation.NSString

Nilai Properti

Konstanta NSString, harus digunakan sebagai token untuk NSNotificationCenter.

Atribut

Keterangan

Konstanta ini dapat digunakan dengan NSNotificationCenter untuk mendaftarkan pendengar untuk pemberitahuan ini. Ini adalah NSString alih-alih string, karena nilai-nilai ini dapat digunakan sebagai token di beberapa pustaka asli alih-alih digunakan murni untuk konten string mereka yang sebenarnya. Parameter 'pemberitahuan' ke panggilan balik berisi informasi tambahan yang khusus untuk jenis pemberitahuan.

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


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

void Setup ()
{
    NSNotificationCenter.DefaultCenter.AddObserver (CNContactStore.NotificationDidChange, Callback);
}

Berlaku untuk