暫停NSURLSessionDataTask後,我的init NSURLSessionDataTask與跟蹤方法仍然超時我在AFN3.1.0
- (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler;
然後調用setDataTaskDidReceiveResponseBlock
和setDataTaskDidReceiveDataBlock
將數據寫入到文件。 然後我打電話suspend
,但在timeoutInterval後我得到了帶有超時錯誤的completionHandler。
文件有關暫停: /* * Suspending a task will prevent the NSURLSession from continuing to * load data. There may still be delegate calls made on behalf of * this task (for instance, to report data received while suspending) * but no further transmissions will be made on behalf of the task * until -resume is sent. The timeout timer associated with the task * will be disabled while a task is suspended. -suspend and -resume are * nestable. */
我想知道如何停止的任務,爲什麼我叫暫停這樣它不工作