3

Am I missing something here with Multitasking feature. I know we can execute a task in background, but what I really need is that task continues execution when app goes in background. So what I need is different than starting a new task in background. If images are being loaded in a view and user presses the home button to make the app go in background, I want that images continue to load and when user makes the app active again, he can see all the loaded images. How can this be done? Thanks a lot.

Sachin Palewar
  • 479
  • 4
  • 15

2 Answers2

0

Documentation on background task execution is on Apple's site in the iPhone Application Programming Guide.

Alex Reynolds
  • 94,180
  • 52
  • 233
  • 338
  • I have already gone through that page. What I don't understand is can we continue a task which was already running when the app was in Forground? I don't want to start a task when app goes in background as the documentation suggests, I want my current task to keep executing even when app changes from foreground to background. – Sachin Palewar Jul 10 '10 at 05:29
  • 2
    Alex I now realise that beginBackgroundTaskWithExpirationHandler: can also be used before app enters background. Although I couldn't find any such sample. I think if we use it when app is still active, task will continue when app goes in background. – Sachin Palewar Jul 13 '10 at 06:48
0

According to mentioned documentation, if you use beginBackgroundTaskWithExpirationHandler: while in foreground, it will keep executing in background until it ends. Once that task has ended, your application is eligible to be suspended.

Max MacLeod
  • 25,335
  • 12
  • 98
  • 129
guirto
  • 195
  • 1
  • 6