27

I'm creating an iOS app who will have to stop the standby timer.

I mean the timer who put the device in standby after 60 seconds that a user does not touch the screen.

How can I do it?

Thanks

Cla
  • 1,770
  • 3
  • 19
  • 35

2 Answers2

46

Try to set UIApplication's idleTimerDisabled property to YES.

[UIApplication sharedApplication].idleTimerDisabled = YES;
Vladimir
  • 169,112
  • 36
  • 383
  • 312
-3

you can also put this line of code and it should work also.

[application setIdleTimerDisabled:YES];
Alex Crawford
  • 321
  • 1
  • 4
  • 16
  • 1
    your variable "application" is not defined as a UIApplication, and needs to be initialised as [UIApplication sharedApplication] – Pega88 Aug 03 '14 at 09:04