Putting iPhone into Sleep Mode programmatically
I had used the following code to prevent the iPhone from entering the sleep mode.
[UIApplication sharedApplication].idleTimerDisabled=YES
But is it possible to put th开发者_开发百科e iphone in Sleep mode programmatically?
No it's not. That is up to the user to decide to do, or not, or when the idle timer is is hit.
Remember, Apple is a consumer-oriented company, where the products are consumer oriented. Developers are more "engineers" than consumers. Yes we consume to, but in different ways. Can you imagine the look on a normal users face if the phone mysteriously shuts off while they're using it? Even if they did tap a button to do it in your app, for instance. It's still non-uniform, and uniformity has been Apple's bread and butter for years.
No sir, we just can't do it cap'n... we don't... have.. the power.
That's just another thing Apple doesn't want us tinkering with.
精彩评论