[notifications] [ios] Added missing NSNotificationCenter removeObserver calls.

This commit is contained in:
Ilya Grechuhin 2016-11-21 10:20:17 +03:00
parent bb32502f4f
commit 0f14f40afa
2 changed files with 7 additions and 3 deletions

View file

@ -101,7 +101,7 @@ static NSString * const kKeyPath = @"subviews";
}
else
{
[self.rootView.superview removeObserver:self forKeyPath:kKeyPath];
[controller.view removeObserver:self forKeyPath:kKeyPath];
[self.rootView removeFromSuperview];
[self.timer invalidate];
}

View file

@ -16,12 +16,16 @@
[self updatePlaceholderVisibility];
NSNotificationCenter * defaultCenter = [NSNotificationCenter defaultCenter];
[defaultCenter addObserver:self selector:@selector(textDidChange:)
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textDidChange:)
name:UITextViewTextDidChangeNotification object:self];
self.clipsToBounds = YES;
}
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self name:UITextViewTextDidChangeNotification object:nil];
}
- (UILabel *)placeholderView
{
if (!_placeholderView)