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,810
  • 3
  • 22
  • 36

2 Answers2

46

Try to set UIApplication's idleTimerDisabled property to YES.

[UIApplication sharedApplication].idleTimerDisabled = YES;
Vladimir
  • 170,431
  • 36
  • 387
  • 313
-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