XCODE7 Beta Network request error: The resource could not being loaded because the APP Transport
Xcode7 Beta Network request error: The resource could not being loaded because the APP Transport Security policy requires the use of a SE Cure connection.
Reprinted from http://blog.csdn.net/feixiang_song/article/details/47188223
The original code in the UIWebView network request error.
Today's upgrade Xcode 7.0 bata found that network access failed.
Didfailloadwitherror ():
Error domain=nsurlerrordomain code=-1022 "The resource could not being loaded because the APP Transport Security policy Requi Res the use of a secure connection. " userinfo={nsunderlyingerror=0x7fce0c9ac400 {Error domain=kcferrordomaincfnetwork code=-1022 "The resource could not being Loaded because the APP Transport Security policy requires the use of a secure connection. " userinfo={nserrorfailingurlstringkey=http://www.baidu.com/, nslocalizeddescription=the resource could not being loaded Because the APP Transport Security policy requires the use of a secure connection., Nserrorfailingurlkey=http://www.baidu. com/}}, nserrorfailingurlstringkey=http://www.baidu.com/, nserrorfailingurlkey=http://www.baidu.com/, Nslocalizeddescription=the resource could not being loaded because the APP Transport Security policy requires the use of a SE Cure connection.}
After Google verified, IOS9 introduced new features App Transport Security (ATS) . Details: App Transport Security (ATS)
The new feature requires that the network access within the app must use HTTPS protocols.
But now the company's projects are using HTTP protocols that use private encryption to keep data secure. It is not immediately possible to change the HTTPS protocol transfer.
Finally, the following solutions are found:
- Add a type in
NSAppTransportSecurity info.plist Dictionary .
NSAppTransportSecurityunder Add NSAllowsArbitraryLoads type, the Boolean value is set toYES
The resource could not being loaded because the APP Transport