[RN] fix duplicate observe
This commit is contained in:
parent
595eae8b67
commit
df58789f22
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue