[RN] fix duplicate observe

This commit is contained in:
Jiajie Zhu 2015-05-31 14:33:59 -07:00
parent 595eae8b67
commit df58789f22
1 changed files with 5 additions and 6 deletions

View File

@ -48,17 +48,16 @@ RCT_EXPORT_MODULE()
for (NSString *name in @[UIApplicationDidBecomeActiveNotification, for (NSString *name in @[UIApplicationDidBecomeActiveNotification,
UIApplicationDidEnterBackgroundNotification, UIApplicationDidEnterBackgroundNotification,
UIApplicationDidFinishLaunchingNotification]) { UIApplicationDidFinishLaunchingNotification]) {
[[NSNotificationCenter defaultCenter] addObserver:self [[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleAppStateDidChange) selector:@selector(handleAppStateDidChange)
name:name name:name
object:nil]; 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; return self;
} }