简体   繁体   English

AFNetworking适用于iOS8,但不适用于iOS9

[英]AFNetworking works for iOS8, but doesn't work for iOS9

What might be wrong if my class responsible for connection works when I run on simulator with iOS8 , but it is not going to work with simulator on iOS9 . 如果当我与模拟器上运行我的类,负责接驳工程什么可能是错误的iOS8 ,但它不会与仿真工作iOS9 What is the reason? 是什么原因?

If you are loading a non-https URL using AFNetworking , you need to add an App Transport Security override in your info.plist file like this: 如果使用AFNetworking加载非https URL,则需要在info.plist文件中添加App Transport Security覆盖,如下所示:

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

You can also add overrides for specific domains, which is a better approach. 您还可以为特定域添加替代,这是一种更好的方法。 More info here: 更多信息在这里:

http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/ http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM