- Better place for removeObserver: calls ios-revival
authorantonc27 <antonc27@mail.ru>
Tue, 03 Nov 2015 01:27:15 +0100
branchios-revival
changeset 11273 68a0df07382b
parent 11272 bb6c553162c5
child 11274 9e0fe32aff59
- Better place for removeObserver: calls Note: viewDidUnload never called since iOS 6
project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m
project_files/HedgewarsMobile/Classes/SingleTeamViewController.m
--- a/project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m	Tue Nov 03 01:22:35 2015 +0100
+++ b/project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m	Tue Nov 03 01:27:15 2015 +0100
@@ -407,7 +407,6 @@
 }
 
 -(void) viewDidUnload {
-    [[NSNotificationCenter defaultCenter] removeObserver:self];
     self.listOfSchemes = nil;
     self.listOfWeapons = nil;
     self.listOfScripts = nil;
@@ -423,7 +422,9 @@
     [super viewDidUnload];
 }
 
--(void) dealloc {
+-(void) dealloc
+{
+    [[NSNotificationCenter defaultCenter] removeObserver:self];
     releaseAndNil(listOfSchemes);
     releaseAndNil(listOfWeapons);
     releaseAndNil(listOfScripts);
--- a/project_files/HedgewarsMobile/Classes/SingleTeamViewController.m	Tue Nov 03 01:22:35 2015 +0100
+++ b/project_files/HedgewarsMobile/Classes/SingleTeamViewController.m	Tue Nov 03 01:27:15 2015 +0100
@@ -401,7 +401,6 @@
 }
 
 -(void) viewDidUnload {
-    [[NSNotificationCenter defaultCenter] removeObserver:self];
     self.teamDictionary = nil;
     self.teamName = nil;
     self.normalHogSprite = nil;
@@ -411,7 +410,9 @@
     [super viewDidUnload];
 }
 
--(void) dealloc {
+-(void) dealloc
+{
+    [[NSNotificationCenter defaultCenter] removeObserver:self];
     releaseAndNil(teamDictionary);
     releaseAndNil(teamName);
     releaseAndNil(normalHogSprite);