Merge pull request #4765 from igrechuhin/notifications

[notifications] [ios] Added missing NSNotificationCenter removeObserv…
This commit is contained in:
Sergey Yershov 2016-11-21 10:43:29 +03:00 committed by GitHub
commit 0b87ac1cab
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)