陈斌彬的技术博客

Stay foolish,stay hungry

iOS 禁止自动休眠

//禁止自动休眠可以通过这一句话搞定:
[UIApplication sharedApplication].idleTimerDisabled=YES;

//当然一定要慎用,记着退出程序时把自动休眠功能开启
UIApplication sharedApplication].idleTimerDisabled=NO;