xCode 9 - iOS 11: NSURLConnection - sendAsynchronousRequest fails

前端 未结 3 1713
醉酒成梦
醉酒成梦 2021-01-04 00:41

I just downloaded the latest version of xCode (9.0 beta (9M136h)).

However, when I try to make a request to my server in iOS 11 simulator (Using NSURLConnection send

3条回答
  •  长情又很酷
    2021-01-04 01:23

    You need to allow your application to run HTTP (no S) connections. By default, Apple only allows HTTPS:

    1. go to your info.plist

      here

    2. then press the plus icon on any of them

    3. Search for "App Transport Security Settings" here

    4. click the little arrow to the left and find "Allow arbitrary loads", by default it is set to "NO" change it to "YES"

提交回复
热议问题