I would like to get notified when ipad\'s date-time settings is changed. Is there any way for that?.
I am using NSDateFormatter to find whether iPad/iphone time mod
How about adding an observer for NSCurrentLocaleDidChangeNotification ? Per Apple, "Re-create any cached date and number formatter objects whenever the current locale information changes."
You may also want to listen to this notification: NSSystemTimeZoneDidChangeNotification
You can do it using two ways:
- (void)applicationSignificantTimeChange:(UIApplication *)application
in your app delegate.Add a observer for UIApplicationSignificantTimeChangeNotification
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(timeChanged:) name:UIApplicationSignificantTimeChangeNotification object:nil];
applicationSignificantTimeChange:
Tells the delegate when there is a significant change in the time.
- (void)applicationSignificantTimeChange:(UIApplication *)application
Parameters
application
The delegating application object.
Discussion
Examples of significant time changes include the arrival of midnight, an update of the time by a carrier, and the change to daylight savings time. The delegate can implement this method to adjust any object of the application that displays time or is sensitive to time changes.
Prior to calling this method, the application also posts a UIApplicationSignificantTimeChangeNotification notification to give interested objects a chance to respond to the change.
If your application is currently suspended, this message is queued until your application returns to the foreground, at which point it is delivered. If multiple time changes occur, only the most recent one is delivered. Availability
Available in iOS 2.0 and later.
Declared In UIApplication.h
For more check UIApplicationDelegate_Protocol