How to track NSSystemClockDidChangeNotification in iPhone SDK

I need to know if the user will change the system time in the springboard settings. You can also report my background program. According to the document, NSSystemClockDidChangeNotification is the only choice. but I can’t get anything:

 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleSysTimeChanged:) name:NSSystemClockDidChangeNotification object:nil]; 

Where am I mistaken? Any suggestions?

+6
source share
1 answer

Your handler method should be implemented in the same class that you add as an observer, and should look like this:

 -(void) handleSysTimeChanged: (NSNotification*) notification { // ... } 
+6
source

Source: https://habr.com/ru/post/890661/


All Articles