NSURLSession: How to increase time out for URL requests?

后端 未结 7 1450
粉色の甜心
粉色の甜心 2020-11-27 15:31

I am using iOS 7\'s new NSURLSessionDataTask to retrieve data as follows:

NSURLSession *session = [NSURLSession sharedSession];

NSURLSessionDat         


        
7条回答
  •  日久生厌
    2020-11-27 15:40

    In my case I was increasing the timeout of the wrong class. My timeout error was solved by increasing the timeout of the URLRequest not the URLSession

    var request = URLRequest(url: url)
    request.timeoutInterval = 30
    

提交回复
热议问题