views:

435

answers:

1

How can I detect lock/unlock events on the i-phone? Assuming it's only possible for jailbroken devices, can you poin me to the correct api?

+2  A: 

For what reason do you need to detect these? If you simply want to know when your app is slept without quitting (as it would be in a lock), you can implement applicationDidBecomeActive: and applicationWillResignActive: in your application's delegates. This will also fire for other reasons, though, such as when the phone rings (but is not answered).

Arclite