Prior to IOS 9 my ViewController class included NSNotificationCenter observers and the @selector() methods got called (code shown below) correctly. However starting iOS 9 the methods no longer gets called. Does anyone have the same problem ? I need to know if there are solutions to this or I need to make Delegate calls from AppDelegate class to my viewController. Thank you in advance.
Note that I had those in viewWillAppear and removeObserver in viewWillDisappear.
I have looked into apple document https://developer.apple.com/library/prerelease/mac/releasenotes/Foundation/RN-Foundation/index.html#//apple_ref/doc/uid/TP30000742 and it states that we no longer need to remove observer for weak link notification so I remove the 'removeObserver' from viewWillDisappear.
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(applicationDidEnterBackground) name:UIApplicationDidEnterBackgroundNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationEnteringForeground) name:UIApplicationWillEnterForegroundNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationBecameActive) name:UIApplicationDidBecomeActiveNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationResignedActive) name:UIApplicationWillResignActiveNotification object:nil];