views:

456

answers:

3

I need to save a big file, sometime it takes a very long time to finish, user might just close the application. I am wondering whether the iPhone SDK could take over the unfinished big task.

Appears iPhone's own mail system could do background send. I prepared a email, click send, then close the mail app immediately. In home page, after several seconds, I heard a sound and the email was delivered.

+2  A: 

You're out of luck. Only Apple's own apps are allowed to operate in the background. But I think your app gets some time to finish up when the user closes the app.

PEZ
+1  A: 

You can't run the app in the background as PEZ says. However you could spin off a thread to perform the task and then at least the user can get on with doing other things in your application.

frankodwyer
+1  A: 

If I remember correctly, your app gets 5 seconds between the user pressing the home button and the iPhone OS killing it if you're not done.

dancavallaro