NSURLConnection finished with error - code -1022

I think it is about App Transport Security.Because your url is not https.Try to change like this in the info.plist file

<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>

You are getting this error because you are not using https url. To fix follow below steps:

  • Right click on info.plist file.
  • Open As Source code.
  • Add below line just before /dict:

    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
    </dict>
    

I was having a similar issue,

NSURLConnection finished with error - code -1200

I was trying to reach a blocked port in my company. Changing the port let me connect normally.

As pointed out below, disabling Firewall could also solve the issue.

Tags:

Ios

Webview