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
  • 478
  • 4
  • 15
  • Documentation on background task execution is on Apple's site in the [iPhone Application Programming Guide](http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html). – Alex Reynolds Jul 09 '10 at 18:49
  • 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
  • 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

1 Answers1

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
  • 26,115
  • 13
  • 104
  • 132
guirto
  • 195
  • 1
  • 6