Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想为我的应用程序做这样的事情。
用户选择一个 lockApp 几分钟后你说 1,2,5,10 像这样,如果用户什么都不做,那么设备应该根据用户选择的时间进入空闲模式。是否可以控制设备的空闲计时器?
您可以通过禁用它
[[UIApplication sharedApplication] setIdleTimerDisabled:YES];
因此,如果您想为此设置超时,您可以创建一个 NSTimer 并触发此方法来控制它。