iphoneiosios4

Is it possible to detect when the "Minute" changes on the status bar clock?


I have a complex problem to describe so Ill save it and just sum up what im trying to do. I am looking to "get notified" when the time on the status bar changes so I can recalculate time till. I am currently calculating time till just fine, but there is that 1 minute window where my calculations and where the time stamp wont match... it all depends on when they opened the app, compared to where the iPhone "seconds" clock was when they opened it.

So in short, can we detect when the minute changes on the status bar? If so, how?

Thanks!


Solution

  • This is what I'd do:

    When the app launches, I'd start a timer that would update every second to check when the time changes.

    The first time I find a time change, I'd invalidate that timer and start one that would fire every minute.

    This minute timer would be in sync with a delay no greater than a second with the clock on the status bar.