コード例 #1
0
		public void Dealloc(){
			NSNotificationCenter defaultCenter = new NSNotificationCenter ();
			defaultCenter.RemoveObserver (this, null);
		}
コード例 #2
0
 /// <summary>
 /// Notificationses the specified notification key.
 /// </summary>
 /// <param name="notificationCenter">The notification center.</param>
 /// <param name="notificationKey">The notification key.</param>
 /// <returns>An observable sequence of NSNotifications.</returns>
 public static IObservable <NSNotification> Notifications(this NSNotificationCenter notificationCenter, NSString notificationKey) =>
 Observable.Create <NSNotification>(obs =>
 {
     var nsObserver = notificationCenter.AddObserver(notificationKey, obs.OnNext);
     return(Disposable.Create(() => notificationCenter.RemoveObserver(nsObserver)));
 });
コード例 #3
0
        public void Dealloc()
        {
            NSNotificationCenter defaultCenter = new NSNotificationCenter();

            defaultCenter.RemoveObserver(this, null);
        }