[[UIApplication sharedApplication] setIdleTimerDisabled:YES];
這樣程式就不會進入螢幕保護狀態了。但是如果使用者手動的方式進入 Lock Mode ,而重新解鎖之後你會發現,原本在執行的 Server 都被關閉了,這個時候你可以在下列函數中重新啟動
- (void)applicationWillEnterForeground:(UIApplication *)application
{
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
/* Start Server */
}
沒有留言:
張貼留言