iphone auto lock value?

只谈情不闲聊 提交于 2020-01-11 10:47:13

问题


Isn't possible to retrieve auto lock value? Or anyone know how to modify the auto lock time like those existing alarm application?

Thanks.


回答1:


You can do it. you need to implement the following methods

- (void)applicationWillResignActive:(UIApplication *)application

This gets called when the phone is locked. In this method I would store the time and then impliment this method on the app delegate.

- (void)applicationDidBecomeActive:(UIApplication *)application

This function will be called when unlocking the phone. Use the time you stored when locking the time to determine how long it has been.

You can use this two methods for custom implementation of auto lock interval.




回答2:


Yes Jason is right. you can use [application setIdleTimerDisabled:YES]; to stop the autosleep. But there is no way to access the auto lock value.

Regards, Raxit



来源:https://stackoverflow.com/questions/4363051/iphone-auto-lock-value

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!