ObjectC "idleTimerDisabled" !?!
I'm seaeching the right way to make work an ObjectC line of code to disable the Idle timer on iPhone (screen goes darker)
The original line of code (found on the web) is :
[UIApplication sharedApplication].idleTimerDisabled = YES;
My side, I can't figure out how to use this exaclty. After a bunch of tries, no way to make it works.
Here is the non working code I tried :
from objc_util import *
#Switch off idle mode (ObjectC)
UIApplication = ObjCClass('UIApplication')
idleTimerDisabled = ObjCClass('idleTimerDisabled')
My_app = UIApplication.sharedApplication()
My_app.idleTimerDisabled = 'YES'
Any idea on the way to make it work ?
The easiest way is to use the method exposed in the console module
import console console.set_idle_timer_disabled(True)
Otherwise, you want to use True, not YES
UIApplication = ObjCClass('UIApplication') My_app = UIApplication.sharedApplication() My_app.idleTimerDisabled = True
Thank a lot.
I wasn't far from finding using ObjectC, but the console method is way easier :)