I am interested in building a Timer Based game such as mafia wars or soemthing like that. I’m stuck on one question.
What would be the best way to retain a timer, even if the app is closed?
Should I do this based on the Device Clock? or should I set a time to a server, and get the time when the device starts up?
If any one knows a better way for this,
let me know.
Thanks.
@lessfame
If you only need to retain the time and show how much time elapsed since the game was closed (i.e. you don’t need to notify the user when the time is up), you can use the
[NSDate timeIntervalSinceNow]method to determine the amount of milliseconds that passed between two times.