NSMutableURLRequest timeout doesn't trigger if data starts to load but not webViewDidFinishLoad

后端 未结 2 1088
小鲜肉
小鲜肉 2020-12-21 19:09

I am loading a UIWebview and requesting a URL that can take some time to finish loading. The request starts and begins to receive data. However, it doesn\'t appear that th

2条回答
  •  星月不相逢
    2020-12-21 19:32

    The timeout for the NSURLRequest is for the connection. If you get connected and it just takes a long time for the server to response, he timeout will do you no good. You will need to setup your own NSTimer for the timeout you want and cancel the request yourself.

提交回复
热议问题