简体   繁体   English

应用程序空闲计时器禁用不起作用

[英]Application idle Timer disable not working

Application idle timer disable is not working properly after record video from the application. 从应用程序录制视频后,应用程序空闲计时器禁用功能无法正常工作。 I put below code in my application did finish launching. 我在应用程序中放置了以下代码,并完成了启动。 please suggest me if any one have idea to handle idle timer. 如果有人有想法处理空闲计时器,请提出建议。

[[UIApplication sharedApplication] setIdleTimerDisabled: YES];

In the past there have been some bugs in iOS, in which it forgets that you have set idleTimerDisabled , for example after you have used the UIImagePickerController to take a picture. 过去,iOS中存在一些错误,例如,在使用UIImagePickerController拍照之后,它会忘记您设置了idleTimerDisabled I am not sure whether Apple has fixed those bugs completely yet. 我不确定苹果是否已经完全修复了这些错误。

A work-around is to set it more often, for example in the viewWillAppear of your main view. 一种变通方法是更频繁地设置它,例如在主视图的viewWillAppear中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM