-4

The problem is as follows: I have the time (in hh:mm:ss) when a user logs into the app. Now I have to implement a clock from that "log-in" time to the current time. This should be updated every second in the display. As an example: Say, the user logs in at 09:00:00 and the current time is 10:00:00. Then , the display should say 01:00:00 -> 01:00:01 -> 01:00:02 -> ...... So, the display is updated every second.

I am new to Xcode and objective C. Could you please suggest some approach? Thank You

user1415459
  • 159
  • 1
  • 2
  • 11

1 Answers1

0

You can start and stop timer in app delegate methods like

application:willFinishLaunchingWithOptions, application:didFinishLaunchingWithOptions, applicationDidBecomeActive: applicationWillResignActive: applicationDidEnterBackground: applicationWillEnterForeground: applicationWillTerminate:

Refer to the following document for more info:

http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iphoneosprogrammingguide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html

Obj-Swift
  • 2,802
  • 3
  • 29
  • 50