iOS Error Code=-1003 “A server with the specified hostname could not be found.”

前端 未结 5 1507
花落未央
花落未央 2021-02-07 01:41

I am trying to load image from URL on the iphone, image is there and I can open it in safari with same link, but not in the app:

Error Domain=NSURLErrorDomain Co         


        
5条回答
  •  天涯浪人
    2021-02-07 02:07

    The host name in your URL is wrong because the message you are getting back explicitly states it can't find a server with that host name.

    The mst likely cause is that you have forgotten to put a forward slash between the base URL and the email e.g. if your base URL is

    http://example.com
    

    and your email is

    jeremyp@example.com
    

    You construct

    http://example.comjeremyp@example.com
    

    Put a break point on the line that creates the URL and inspect the string it is trying to create it from. It'll probably then be pretty obvious exactly what you are doing wrong.

提交回复
热议问题