I am getting this error NSURLConnection finished with error - code -1002. I have added the code below into my info.plist. Does anyone know why?
Thanks in advance
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionMinimumTLSVersion</key>
<string>TLSv1.0</string>
</dict>
I had the same issue but my case was different. Here is the code that generated the error:
Later I found out that imageUrl was not actually a url at all it was just a string, literally "false" thats it. and what made it worse that it was not caught in both else statements.
so I solved it by just adding the guard below:
Now I can call the createItem function and save my item without image successfully. So check your URLs carefully specially if you're getting them from an API.
I think it is about App Transport Security.Because your url is not https.Try to change like this in the info.plist file
You can check all error codes and there meanings on following link
NSError by NSHipster
The status of error - code -1002 as per the documentation Please check. ,
https://developer.apple.com/documentation/foundation/1508628-url_loading_system_error_codes/nsurlerrorunsupportedurl?language=objc
please check the url once again with postman.