[Exception fix] fix exception on getLC from obrserver not remove

This commit is contained in:
Brieuc Viel 2017-12-12 14:39:02 +01:00
parent cd3ab3aeb7
commit 25ae4525d7
2 changed files with 2 additions and 0 deletions

View file

@ -202,6 +202,7 @@ static RootViewManager *rootViewManagerInstance = nil;
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
[NSNotificationCenter.defaultCenter removeObserver:self];
[NSNotificationCenter.defaultCenter removeObserver:self name:UIDeviceBatteryLevelDidChangeNotification object:nil];
[[UIDevice currentDevice] setBatteryMonitoringEnabled:NO];
}

View file

@ -234,6 +234,7 @@ CGRect IASKCGRectSwap(CGRect rect);
- (void)viewDidDisappear:(BOOL)animated {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationWillTerminateNotification object:[UIApplication sharedApplication]];
// hide the keyboard
[self.currentFirstResponder resignFirstResponder];