OGeek|极客世界-中国程序员成长平台

标题: objective-c - UIApplication空闲定时器 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-11 22:43
标题: objective-c - UIApplication空闲定时器

这是一个简单的问题,我似乎找不到任何关于它的信息,但我只想知道下面的代码是否会让我的应用程序被拒绝。基本上,这是一个私有(private) API

[application setIdleTimerDisabled:YES];

我想将此添加到我的 AppDelegate 中的 didFinishLaunchingWithOptions 下。我只是不想使用如此简单的东西并让我的应用程序被拒绝。感谢您提供任何信息!



Best Answer-推荐答案


这是公开的,尽管苹果建议:

Important You should set this property only if necessary and should be sure to reset it to NO when the need no longer exists. Most applications should let the system turn off the screen when the idle timer elapses. This includes audio applications. With appropriate use of Audio Session Services, playback and recording proceed uninterrupted when the screen turns off. The only applications that should disable the idle timer are mapping applications, games, or similar programs with sporadic user interaction.

因此,如果您的应用与他们描述的一样,或者您谨慎使用它,那么您应该没问题。

关于objective-c - UIApplication空闲定时器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10200522/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4