IOS9-xcode7 Common Errors https troubleshooting
Errors
The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.
Tom is not panic. This is the upgraded https problem of ios9. It is easy to solve. Close him. We still use http
Solution
1: add the NSAppTransportSecurity type Dictionary to Info. plist.
2: Add a Boolean of the NSAllowsArbitraryLoads type under NSAppTransportSecurity. The value is set to YES.
3: note that there is also an Info. plist in the unit test. modifying that file does not work!
Others
If you want some domain names to support https, you can also configure it as follows:
Supplemented the configuration method
If HTTPS is not supported, add exceptions first.
The method for adding exceptions is also simple:
Left click Info. plist and select open with source code
Then add a configuration similar to the following:
NSAppTransportSecurity
NSExceptionDomains
qq.com
NSIncludesSubdomains
sina.com.cn
NSIncludesSubdomains
According to the domain name modification you need, NSIncludeSubdomains includes subdomains.