I'm using a 3rd party library to load data in an iPad app and because some of the large blocks of data I want to load can take an age to process I do this as a background task (otherwise the device times out, plus it maintains functionality in the UI).
This is great and works a treat, except if you press the home button to send the app into the background and then click back on the app when the app comes back the iOS has moved the thread into the foreground which basically means a few seconds later it times out and kills the app...
I'm struggling to see what possible fix there is for this.
Are you sure the background thread gets moved into the foreground? Or does the background thread crash? Or perhaps it dies when the app is left, and then the foreground thread crashes when it tries to communicate with the dead background thread?
__________________ Recall It!Tag your notes. Tag your photos. Tag your thoughts. Tag your life.
I'm using a 3rd party library to load data in an iPad app and because some of the large blocks of data I want to load can take an age to process I do this as a background task (otherwise the device times out, plus it maintains functionality in the UI).
This is great and works a treat, except if you press the home button to send the app into the background and then click back on the app when the app comes back the iOS has moved the thread into the foreground which basically means a few seconds later it times out and kills the app...
I'm struggling to see what possible fix there is for this.
Anyone any ideas?
You should pause your background thread when your app gets suspended, and then start it up again when your app comes back to the foreground.
__________________
Highlight PDF text like no other app: iHighlight (now available for iPad and iPhone!)
-----
Create iPhone lists with no typing: Insta-List
-----
Make spelling fun, and create your own tests: iWillSpell
-----
A fast, elegant flashlight app: Insta-Light
-----
I'm using a 3rd party library to load data in an iPad app and because some of the large blocks of data I want to load can take an age to process I do this as a background task (otherwise the device times out, plus it maintains functionality in the UI).
This is great and works a treat, except if you press the home button to send the app into the background and then click back on the app when the app comes back the iOS has moved the thread into the foreground which basically means a few seconds later it times out and kills the app...
I'm struggling to see what possible fix there is for this.
So it seems the background thread is suspended and resumed when the app resumes, but it should not move to the foreground. Perhaps there is some other problem why AppKit kills the app? Also, have you considered using the task completion API for the background processing?