iOS 9中检测通知的以下代码不会触发选择器方法。在之前的版本(例如8.4)中,它可以正常运行。有人知道为什么吗?
[[NSNotificationCenter defaultCenter]addObserver:self
selector:@selector(yourMethod)
name:UIApplicationDidBecomeActiveNotification
object:nil];
- (void)yourMethod {NSLog(@"aaaaaaa");}