I’m displaying 10 questions in a view controller. I want to calculate the time taken to answer those questions.Means I want to set time count down after the time reaches to zero I want to display an alert. Please help me.
Thanks in advance.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You seems to want 2 things.
One is elapsed time between the start of the question until it get answer, you can do that with:
Reference:
http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSDate_Class/Reference/Reference.html
The second is to use
NSTimerfor counting down. You can do that with the following code:The method that will be invoked by timer.
This should work.
Reference:
http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSTimer_Class/Reference/NSTimer.html