2016-10-22 8 views
1

を呼び出していないNSNotificationメソッドを受け取ります。あなたは、通知を投稿するときは、私は、レジスタ通知のために、以下の使用を持っている

+0

befor最初

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(AllSearch:) name:filter object:nil]; 

をaddObserverする必要があるコードチェックは、メモリ内にまだ観察対象ですか?投稿する前にaddObserverを終了しますか? – Larme

+0

私はこれを最初に使用しています。 - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView { [[NSNotificationCenter defaultCenter] postNotificationName:filter object:nil]; } そして、私は他のViewControllerで使用しています。 [[NSNotificationCenter defaultCenter] addObserver:セルフセレクタ:@selector(AllSearch :) name:フィルタオブジェクト:nil]; 今私はviewControllerクラスです。テーブルビューをスクロールすると "AllSearch"が呼び出されません。 –

+0

@ハリモハンあなたは最初にこのコード[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(AllSearch :) name:filter object:nil]; addObserver postnotificationの後の –

答えて

0

plzはあなたがpostNotification

[[NSNotificationCenter defaultCenter] postNotificationName:filter object:nil]; 
+0

ありがとう、完璧 –

+0

@ハリモハンようこそ:)それを正しくマークしてください。 –

関連する問題