• 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: Ashley Clark <email@hidden>
  • Date: Wed, 10 Dec 2008 23:36:45 -0600

On Dec 10, 2008, at 8:06 PM, Nick Zitzmann wrote:

On Dec 10, 2008, at 6:41 PM, Chunk 1978 wrote:

i read in the docs that the use of NSCalandarDate is discouraged
because it's going to be depreciated for OS X 10.6... i'm not really
sure if depreciated means that any code with NSCalandarDate will no
longer function with the new OS or if it will just be considered out
dated...


The OP said NSDateComponents, not NSCalendarDate. NSDateComponents will not be deprecated any time soon. And despite what the docs say, I don't think NSCalendarDate is going away soon, because only NSCalendarDate supports encapsulating a time zone within a date.

In any case, if you can avoid using NSCalendar/NSDateComponents to make a calendrical calculation, I'd recommend you do so. NSCalendar is quite slow to make even the most basic of calculations, especially on PPC Macs.


Certainly in a tight loop it might not be appropriate to use NSCalendar but the OP was using them for display in a timer that only fired once a second. I'd argue that the NSCalendar/NSDateComponns method calls are more readable than modulo arithmetic for most people.

I'd be interested in knowing what kind of performance you saw on PPC Macs though that would cause you to write them off in all situations. I've not come across that in my testing.


Ashley

_______________________________________________

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


  • Follow-Ups:
    • Re: Countdown With NSTimer - Hours, Minutes, Seconds Remaining?
      • From: "Chunk 1978" <email@hidden>
References: 
 >Countdown With NSTimer - Hours, Minutes, Seconds Remaining? (From: "Chunk 1978" <email@hidden>)
 >Re: Countdown With NSTimer - Hours, Minutes, Seconds Remaining? (From: Ashley Clark <email@hidden>)
 >Re: Countdown With NSTimer - Hours, Minutes, Seconds Remaining? (From: "Chunk 1978" <email@hidden>)
 >Re: Countdown With NSTimer - Hours, Minutes, Seconds Remaining? (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: [MEET] BYU CocoaHeads meeting Thu 12/11
  • Next by Date: efficiency of Xquery vs NSXMLElement attributes
  • Previous by thread: Re: Countdown With NSTimer - Hours, Minutes, Seconds Remaining?
  • Next by thread: Re: Countdown With NSTimer - Hours, Minutes, Seconds Remaining?
  • Index(es):
    • Date
    • Thread