开发者

iPhone and Sleep

开发者 https://www.devze.com 2022-12-19 09:14 出处:网络
I\'m new to iPhone SDK. Any idea how to put the开发者_JAVA技巧 iPhone into the sleep mode from within the code (my application), as if the user has clicked the sleep/wake button?

I'm new to iPhone SDK.

Any idea how to put the开发者_JAVA技巧 iPhone into the sleep mode from within the code (my application), as if the user has clicked the sleep/wake button?

Best regards.


Your UIApplicationDelegate will have

- (void)applicationWillResignActive:(UIApplication *)application

called when the lock button is pressed but there does not seem to be a way to trigger this from code.

I'm pretty sure this will be disallowed.

You are not permitted to make changes to the state of the device (change volume etc) which would not be expected by the user.


There is no offical way to make the iPhone or iPod go into sleep mode or to lock the screen.


You have to remember that the iPhone is not a little laptop. It is also a phone and therefor an emergency communications device. Developers are not allowed to do anything that might interfere with the users control of the phone.

0

精彩评论

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