我有一种情况,当设备收到推送通知时,我会发送NSURLSession和NSURLConnection.我有几个关于NSURLSession的问题.
解决方法
看起来你需要处理重试.
When any task completes,the NSURLSession object calls the delegate’s
URLSession:task:didCompleteWithError: method with either an error
object,or nil if the task completed successfully. If the task is a
resumable download task,the NSError object’s userInfo dictionary
contains a value for the NSURLSessionDownloadTaskResumeData key. Your
app should use reachability APIs to determine when to retry,and
should then call downloadTaskWithResumeData: or
downloadTaskWithResumeData:completionHandler: to create a new download
task to continue that download. Go to step 3 (creating and resuming
task objects).