• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTimer not firing if date changed in Sys Prefs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTimer not firing if date changed in Sys Prefs


  • Subject: Re: NSTimer not firing if date changed in Sys Prefs
  • From: Douglas Norton <email@hidden>
  • Date: Thu, 31 Mar 2005 15:42:07 +0100

On 31 Mar 2005, at 15:10, Sean McBride wrote:

So say I run the above code at 22:00, then change the clock to 23:59, my
timer does not fire a minute later.


Am I expecting too much? :)

I wouldn't say so. While it may be a very rare case that the user
changes their time, it may happen twice a year automatically depending on
if the time will auto-adjust for daylight savings.

Well I've filed a bug. At the very least I think the documentation
should be clearer. For initWithFireDate: it says "Initializes a new
NSTimer that, when added to a run loop, will fire at 'date'...". But it
doesn't quite do that. :) It probably computes the interval from now to
'date' then calls timerWithTimeInterval.

From your description of the problem, I would agree with your conclusion.


To workaround, you could install a timer that fires after a minute but only does the meaningful thing when the original fire time has passed, and otherwise requeues itself a minute later.

The downside is that if you have several tasks to perform, and the Mac is put to sleep during the period when they should have fired, all those tasks get triggered simultaneously once the Mac awakes.

Douglas

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: NSTimer not firing if date changed in Sys Prefs (From: Ricky Sharp <email@hidden>)
 >Re: NSTimer not firing if date changed in Sys Prefs (From: "Sean McBride" <email@hidden>)

  • Prev by Date: Re: trouble getting c-chars from NSString
  • Next by Date: Re: NSConcreteNotifyingMutableAttributedString
  • Previous by thread: Re: NSTimer not firing if date changed in Sys Prefs
  • Next by thread: handle kill of foundation tool
  • Index(es):
    • Date
    • Thread