2

i created a NSURLSessionUploadTask task

private lazy var uploadSession: NSURLSession = {
    let sessionConfiguration = NSURLSessionConfiguration.backgroundSessionConfigurationWithIdentifier("com.foo.bar")
    sessionConfiguration.HTTPMaximumConnectionsPerHost = 1
    let session = NSURLSession(configuration: sessionConfiguration, delegate: self, delegateQueue: nil)
    return session
}()

let task = uploadSession.uploadTaskWithRequest(request, fromFile: NSURL(fileURLWithPath: path))

after creation i am not calling task.resume()

when i press the home button and return to the app the task is still in "suspend" mode, but when i to this process again, all the tasks that i created change the state to resume and starts uploading.

i didn't find anything in apple docs that can lead to such behavior, any ideas ?

edit:

see the example project - https://github.com/valeriyvan/NSURLSession-test

Bar
  • 603
  • 1
  • 7
  • 19

0 Answers0