tags:

views:

36

answers:

1

Hello,

How can I prevent an application from exiting immediately? If the user press the home button while the application is saving a picture to the photo album, only a part of the picture is saved!

Thanks!

+3  A: 

You can't. You can put code in your App Delegate's

- (void)applicationWillTerminate:(UIApplication *)application

Function to attempt to quickly finish saving the picture and notify the user that they prematurely quit the application, but there's nothing you can do to prevent a user from pressing the home button and quitting your app.

John Wang
To add, the OS puts you on a timer in the applicationWillTerminate method. If you take longer than the timer, then your app will be hard terminated. There is no way around this.
Brandon Bodnár