How do i handle the user pressing the home button at any time, while my app is still processing stuff with the server?
I have this problem both in ios3 & ios4 - i believe maybe th开发者_Python百科e answers would be different because in ios4 it can last in the background.
how do you usually handle such events? Thanks, Itay
Typically you close all your connections, save your state so that you can renew those connections on restart, and allow your application to close. Apple's guidelines about this are pretty clear.
Check out the Multitasking section of the iOS Application Programming Guide. This tells you how to handle the various types of shutdown/suspension scenarios and how to request more time for specific allowed background operations.
精彩评论