Error: Error Domain=NSURLErrorDomain Code=-1001 “The request timed out.”

匆匆过客 提交于 2019-11-27 04:48:08

There was no issue in the code. I guess the simulator internally was not able to connect to the internet, so that is why it was not able to connect to the server after providing various timeout intervals. But it worked completely fine when I executed another day. Thanks to @Andrew Jaffee for helping me to find this issue.

iOS Simulator -> Reset Content and Settings; worked for me

agrippa

Had this problem and had a different resolution so I thought I'd add it here:

Basically, I was sending some parameters when it should have been a clean GET request. Deleted the parameters, GET request worked just fine.

sha123

I was calling local server connection and was getting this error. I was using different network in my device and phone. When I connected both to same wifi, it worked.

This can happen if your network configuration changes while the simulator is running. Please reboot the simulator runtime (eg: quit/relaunch the iOS Simulator.app) and that will likely fix your problem.

If the problem persists, please update your question to indicate that the issue you are experiencing is not this known problem. Thanks.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!