From cc89c3d0ffea4ed803fb793e2735b6acfcf71a02 Mon Sep 17 00:00:00 2001 From: Clement T Date: Wed, 21 May 2014 17:57:23 +0800 Subject: [PATCH] Fix issue of removing notifications from the same thread. --- CTAssetsPickerController/CTAssetsGroupViewController.m | 3 ++- CTAssetsPickerController/CTAssetsViewController.m | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CTAssetsPickerController/CTAssetsGroupViewController.m b/CTAssetsPickerController/CTAssetsGroupViewController.m index e7b919ec..87f4690c 100644 --- a/CTAssetsPickerController/CTAssetsGroupViewController.m +++ b/CTAssetsPickerController/CTAssetsGroupViewController.m @@ -221,7 +221,8 @@ - (void)addNotificationObserver - (void)removeNotificationObserver { - [[NSNotificationCenter defaultCenter] removeObserver:self]; + [[NSNotificationCenter defaultCenter] removeObserver:self name:ALAssetsLibraryChangedNotification object:nil]; + [[NSNotificationCenter defaultCenter] removeObserver:self name:CTAssetsPickerSelectedAssetsChangedNotification object:nil]; } diff --git a/CTAssetsPickerController/CTAssetsViewController.m b/CTAssetsPickerController/CTAssetsViewController.m index e18c530a..ab9bd4ce 100644 --- a/CTAssetsPickerController/CTAssetsViewController.m +++ b/CTAssetsPickerController/CTAssetsViewController.m @@ -211,7 +211,8 @@ - (void)addNotificationObserver - (void)removeNotificationObserver { - [[NSNotificationCenter defaultCenter] removeObserver:self]; + [[NSNotificationCenter defaultCenter] removeObserver:self name:ALAssetsLibraryChangedNotification object:nil]; + [[NSNotificationCenter defaultCenter] removeObserver:self name:CTAssetsPickerSelectedAssetsChangedNotification object:nil]; }