• 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: Countdown With NSTimer - Hours, Minutes, Seconds Remaining?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Countdown With NSTimer - Hours, Minutes, Seconds Remaining?


  • Subject: Re: Countdown With NSTimer - Hours, Minutes, Seconds Remaining?
  • From: "Sean McBride" <email@hidden>
  • Date: Tue, 6 Jan 2009 12:48:52 -0500
  • Organization: Rogue Research Inc.

On 1/4/09 1:17 AM, Chunk 1978 said:

>since this timer i'm writing is based on NSDate, it's effected if the
>computer's clock is manually changed... that i don't mind, because who
>really need to ever manually set their clock on the computer...
>however, i'm concerned that if (probably when) my timer is running
>during a daylight savings shift it will add/subtract an hour... i
>guess there's no avoiding this?  or maybe apple took this into account
>and therefore currently running code is not effected by a daylight
>savings shift?

To get notified of either a DST change, or the user manually changing
the clock, the only way is to use a Carbon event:

	EventTypeSpec eventType;
	eventType.eventClass = kEventClassSystem;
	eventType.eventKind = kEventSystemTimeDateChanged;

	EventHandlerUPP eventHandlerUPP = Ne
wEventHandlerUPP(DateTimeChangeEventHandler);
	EventHandlerRef	eventHandlerRef = NULL;
	(void)InstallApplicationEventHandler(
		eventHandlerUPP,	// inHandler
		1,					// inNumTypes
		&eventType,			// inList
		self,				// inUserData
		&eventHandlerRef);

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Countdown With NSTimer - Hours, Minutes, Seconds Remaining? (From: "Chunk 1978" <email@hidden>)

  • Prev by Date: RE: Table sort image question
  • Next by Date: Re: Removing CALayer after Animation
  • Previous by thread: Re: Countdown With NSTimer - Hours, Minutes, Seconds Remaining?
  • Next by thread: How to create a simple service in Leopard?
  • Index(es):
    • Date
    • Thread