1

I am working on a simple game that requires UIAccelerometer without any screen tapping interaction. In the default mode, the screen goes into a power saving mode periodically. How can I make the screen to stay active throughout the entire time what the app is active?

Winston Chen
  • 6,799
  • 12
  • 52
  • 81

1 Answers1

6

Use [UIApplication sharedApplication].idleTimerDisabled = YES to prevent the iPhone to go to sleep-mode.

marcus
  • 2,521
  • 1
  • 23
  • 32
  • 1
    But be careful when using this, make sure you allow idling in situations where the game is kind of idling - e.g. main-menu, pause mode, ... - to prevent excessive battery draining and possible rejection. – Till May 28 '11 at 15:55
  • thanks for the heads up! I will pay attention to these points. – Winston Chen May 28 '11 at 16:25