iPod goes to sleep when only accelerometer is used
I have a problem with my current game.In this game i have to move a pouch using accelerometer , but the problem is w开发者_如何转开发hen i use only accelerometer (without any touch in screen) iPod screen become dim and then goes to sleep.
So is there any parameter which i need to set to refrain iPod/iPhone from going to sleep.
To disable auto-sleep:
[UIApplication sharedApplication].idleTimerDisabled = YES;
To re-enable:
[UIApplication sharedApplication].idleTimerDisabled = NO;
Reference: http://developer.apple.com/library/ios/documentation/uikit/reference/UIApplication_Class/Reference/Reference.html#//apple_ref/occ/instp/UIApplication/idleTimerDisabled
精彩评论