0

I'm trying to figure out if there's a way to track if the current device date is within a specific time range and get notified.

Example:

Say I have a start time of December 2, 2014 at 11AM and an end time of December 2,2014 at 1PM. I want to observe the [NSDate date] and update the UI if the current date enters the date range.

Is this possible? Can I do this with KVO?

Thanks!

EDIT: My question isn't about doing a check. My question is more about something like "firedate" which gets fired when I enter a time range!

user754905
  • 1,799
  • 3
  • 21
  • 29
  • See also [Check if the time and date is between a particular date and time](http://stackoverflow.com/q/10671468) – jscs Dec 02 '14 at 19:40
  • How is this question duplicate? I'm trying to keep the app open and have a notification/observer that gets fired when the clock enters this date range be actively checking. – user754905 Dec 03 '14 at 20:11
  • 2
    Use `-[NSTimer initWithFireDate:interval:target:selector:userInfo:repeats:]` – bneely Dec 03 '14 at 21:01
  • If you want something to happen at a certain time, you have to check what time it is. – jscs Dec 03 '14 at 23:15
  • Bneely gave me the right answer. Unfortunately, you marking this as duplicate means that I cant award him the answer. – user754905 Dec 23 '14 at 22:36

0 Answers0