Im writing a simple clock app and am looking for a way to call a method when the hour changes (or minute of second etc etc). If someone could point me in the right direction for this i would much appreciate it.Perhaps the kind of instance that calls a method for an alarm, im not sure?
Share
You could schedule an NSTimer with
-initWithFireDate:..., with the fire date set to whole hours.If you’re writing a clock app with precision down to seconds for humans, it is easier to ignore sub-second differences and use
+scheduledTimerWithTimeInterval:...directly, e.g.