Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent Ipod Touch Application from going to sleep

I am building an application for the ipod touch that needs to run for several time (like an alarm clock). I would like to prevent the ipod touch from going to sleep unless the use manually exit the application. Is this possible with the current SDK?

like image 406
Oscar Del Ben Avatar asked Mar 30 '10 08:03

Oscar Del Ben


People also ask

How do you keep iPod touch screen on all the time?

You can goto Settings> General> Auto-Lock> and change the time to Never. This will stop the iPod touch from automatically locking.


1 Answers

You can disable the sleep mode:

[[UIApplication sharedApplication] setIdleTimerDisabled:YES];
like image 58
kharrison Avatar answered Sep 29 '22 09:09

kharrison