From 25ae4525d709554a615497674208ae1539e3da15 Mon Sep 17 00:00:00 2001 From: Brieuc Viel Date: Tue, 12 Dec 2017 14:39:02 +0100 Subject: [PATCH] [Exception fix] fix exception on getLC from obrserver not remove --- Classes/PhoneMainView.m | 1 + .../InAppSettingsKit/Controllers/IASKAppSettingsViewController.m | 1 + 2 files changed, 2 insertions(+) diff --git a/Classes/PhoneMainView.m b/Classes/PhoneMainView.m index 7a54ed38a..42e992a8b 100644 --- a/Classes/PhoneMainView.m +++ b/Classes/PhoneMainView.m @@ -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]; } diff --git a/Classes/Utils/InAppSettingsKit/Controllers/IASKAppSettingsViewController.m b/Classes/Utils/InAppSettingsKit/Controllers/IASKAppSettingsViewController.m index 9fe942583..ec99769a9 100755 --- a/Classes/Utils/InAppSettingsKit/Controllers/IASKAppSettingsViewController.m +++ b/Classes/Utils/InAppSettingsKit/Controllers/IASKAppSettingsViewController.m @@ -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];