tags:

views:

2764

answers:

2

I'm working on an app that requires no user input, but I don't want the iPhone to enter the power saving mode.

Is it possible to disable power saving from an app?

+31  A: 
[[UIApplication sharedApplication] setIdleTimerDisabled:YES];
lajos
Does it matter where this line of code is used? Should it be in the AppDelegate or the App's main viewcontroller?
Code
A: 

So for those of us less technical how do we take the command line above and implement it on our iPhone?

Travis
that's not a command line, that's a line of code to be added to a particular application.
DDaviesBrackett
Um, you don't. That isn't a command line; it is a line of code that goes inside an application. If you aren't writing an iPhone application, this does absolutely nothing for you. Also, please don't answer a question with a question - ask a new question and reference the existing question if needed.
Charles Boyung