开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜