views:

57

answers:

1

I want to display current time in my iPhone app using my own custom graphics. What's the most efficient way to get the hours, minutes and seconds info? I thought about using NSDateFormatter to get each part but this seems to be too CPU intensive.

+1  A: 

You'll want to use NSDateComponents. This answer on SO provides an example.

progrmr
Also take a look at this answer on SO. It's a little more specific to your question http://stackoverflow.com/questions/743140/how-do-i-get-the-current-hour-using-cocoa
probablyCorey