Reputation: 3249
I am creating an iPad application on iOS5.0. I need it to close down if the user is in the app and presses the power off button on the iPad. The user would need to restart the app once he clicks the power button. How should I accomplish this?
Thanks in advance for your help on this one.
Upvotes: 4
Views: 788
Reputation: 946
set this key
Application does not run in background=NO
in App-info.plist
file, then add exit(0);
to applicationDidEnterBackground
Upvotes: 1
Reputation: 1179
You can exit(0) in the applicationWillResignActive method of your delegate but it will kill the app if there is a phone call or something. And apple will block it.
Upvotes: 0
Reputation:
you can try this....
UIApplicationExitsOnSuspend to your Info.plist
Upvotes: 0