_BSMachError XCode 7 Beta

前端 未结 8 1626
后悔当初
后悔当初 2020-12-08 00:15

I am getting the following error when I am running my code in Xcode7 with Swift2, after presenting a view controller through a push segue:

_BSMachError: (os/         


        
8条回答
  •  春和景丽
    2020-12-08 00:53

    Although this problem seems to persist as a bug and will likely be fixed, it stems from the new App Transport Security that has been implemented in iOS 9.

    If your application pulls data from a web server, in order to populate the View Controller that you will be presenting, you can resolve these errors by verifying/granting access to the particular site(s) you're pulling from.

    In order to address this you will add the following to your App's .plist file:

    • You may want to alter your ATS Exception Dictionary to fit your needs

      NSAppTransportSecurity
      
          NSExceptionDomains
          
              testdomain.com
              
                  NSIncludesSubdomains
                  
                  NSExceptionAllowsInsecureHTTPLoads
                  
                  NSExceptionRequiresForwardSecrecy
                  
                  NSExceptionMinimumTLSVersion
                  TLSv1.2
                  NSThirdPartyExceptionAllowsInsecureHTTPLoads
                  
                  NSThirdPartyExceptionRequiresForwardSecrecy
                  
                  NSThirdPartyExceptionMinimumTLSVersion
                  TLSv1.2
                  NSRequiresCertificateTransparency
                  
              
          
      
      

    More details to this solution can be found here or here The Apple Documentation for App Transport Security is worth reading too.

提交回复
热议问题