ios - How to display time in Objective C -


i have application in objective-c. have nsdate, of 2014-01-01, have displayed on screen.

what want way increment date after time interval. example, every 5 seconds, date should increment 1 day.

i want happen independently of other tasks, maybe on thread. have other operations happening during date updating.

edit: solved!

use nstimer when fires, change date. need read nsdate. have implicitly midnight. nsdate exact point in time , means time part of it. nstimezone part of it. nscalendar well. give human readable value nstimeinterval value nsdate wraps in object , number of seconds since reference date positive or negative.

the problem dates have no midnight , have two. implicit midnight screw calendrical calculation. set time noon. use 1 of awesome new methods in 10.9 in nsdate.h header , not in docs still.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -