From df58789f222b90e0261e4608060bca0a3df41f27 Mon Sep 17 00:00:00 2001 From: Jiajie Zhu Date: Sun, 31 May 2015 14:33:59 -0700 Subject: [PATCH] [RN] fix duplicate observe --- React/Modules/RCTAppState.m | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/React/Modules/RCTAppState.m b/React/Modules/RCTAppState.m index 8c46655c6..cf8f95910 100644 --- a/React/Modules/RCTAppState.m +++ b/React/Modules/RCTAppState.m @@ -48,17 +48,16 @@ RCT_EXPORT_MODULE() for (NSString *name in @[UIApplicationDidBecomeActiveNotification, UIApplicationDidEnterBackgroundNotification, UIApplicationDidFinishLaunchingNotification]) { - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleAppStateDidChange) name:name object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(handleMemoryWarning) - name:UIApplicationDidReceiveMemoryWarningNotification - object:nil]; } + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(handleMemoryWarning) + name:UIApplicationDidReceiveMemoryWarningNotification + object:nil]; } return self; }