I am building an iPhone app in which I want to time user activity. However, I don't want to count time when the iPhone was locked (or when the user received a phone call) when calculating the times. What is the best way to do this? Is there a UIEvent which my app can receive (and act upon) when the iPhone locks or unlocks?
A:
Look at the UIApplicationDelegate methods applicationWillResignActive:
and applicationDidBecomeActive:
.
Tim
2010-06-14 04:13:06
I've read about this but it is for the whole application - I just want to respond to this event in a single view controller. How might i do this?
Jason
2010-06-14 04:15:30