[英]iPhone screen lock notification to app
How can I be notified that the screen/phone was locked while my app is running? 如何在我的应用程序运行时通知屏幕/手机被锁定? I want to suspend some timers related to refreshing the display in such cases. 在这种情况下,我想暂停一些与刷新显示相关的计时器。
I think your UIApplicationDelegate will receive the following message before the screen gets locked: 我认为您的UIApplicationDelegate会在屏幕锁定之前收到以下消息:
- (void)applicationWillResignActive:(UIApplication *)application
here the link to the documentation: http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIApplicationDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intfm/UIApplicationDelegate/applicationWillResignActive : 这里是文档的链接: http : //developer.apple.com/iphone/library/documentation/UIKit/Reference/UIApplicationDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intfm/UIApplicationDelegate/applicationWillResignActive :
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.