Xcode报错:App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.

Xcode报错解决:

Xcode报错:App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file._第1张图片
Xcode联网问题

Xcode报错提示语:

[6270:534022] App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.

解决方案:

Xcode7以上版本,苹果官方为了安全性考虑,默认Xcode在运行时时无法联网的,需要手动添加设置联网代码:

具体步骤:

1.打开Xcode,鼠标选择info.plist文件

Xcode报错:App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file._第2张图片
info.plist

2.右键info.plist,选择"open As"->"Source Code"

Xcode报错:App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file._第3张图片
打开方式
Xcode报错:App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file._第4张图片
进入plist文件

3.添加联网代码

Xcode报错:App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file._第5张图片
联网的代码

NSAppTransportSecurity

         

                    NSAllowsArbitraryLoads

                   

       

4.复制上面的几行代码,保存文档,运行即可

你可能感兴趣的:(Xcode报错:App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.)