Reputation: 4045
I have web service which i want to use to upload image to the server, web service proxy classes generated by wsdl2objc it uses NSOperation to perform soap calls. Suppose during the upload process i press the home button and application enters the background mode, what will be in that case? will the upload process terminate? or process will complete anyway.
Upvotes: 2
Views: 1164
Reputation: 135548
By default, the OS will freeze your app in the background. When that happens, the remote server will probably close the connection after a while because your app doesn't respond.
You can avoid that by wrapping your upload code in a background task (with the methods beginBackgroundTaskWithExpirationHandler:
and endBackgroundTask:
), in which case the OS will let your app run in the background for another 10 minutes to finish its work.
Upvotes: 5