Ecarrion Ecarrion - 4 months ago 33
iOS Question

How to handle time events on iOS?

I'm coding an iPad app, and I have to change a graphic when the day changes to Sunday.

My straightforward solution is to check the day in the

- (void)applicationDidBecomeActive:(UIApplication *)application
methods, and set a timer like every 10 mins to check if the day have changed to Sunday while the app is active.

Is there another, perhaps more efficient, way to handle this?


In your appliciation delegate, implement the following method: -(void)applicationSignificantTimeChange:(UIApplication *)application

This method is called when the day changes, or if the device's time has been changed in the background for whatever reason (such as changes to time zone).