How to display time in Objective C
I have an application in Objective-C. I have an NSDate, of 2014-01-01, which I have displayed on the screen.
What I want is a way to increment the date after a time interval. For example, every 5 seconds, the date should increment by one day.
I want this to happen independently of other tasks, maybe on another thread. I will have other operations happening during this date updating.
Use NSTimer When it fires, change the date. But you need to read about NSDate. What you have is implicitly midnight. NSDate is an exact point in time and that means time is part of it. NSTimeZone is also part of it. NSCalendar as well. Together they give you a human readable value from an NSTimeInterval value which is what NSDate wraps in an object and is the number of seconds since the reference date positive or negative.
The problem is some dates have no midnight and some have two. So implicit midnight will screw up calendrical calculation. Set the time to noon. Then use one of the awesome new methods in 10.9 but only in the NSDate.h header and not in the docs still.