Xcode7适配

Error Domain=NSURLErrorDomain Code=-1022 "The resource could not be loaded because the App Transport Security policy requires the use of a secure connection." UserInfo={NSUnderlyingError=0x7fba430711b0 {Error Domain=kCFErrorDomainCFNetwork Code=-1022 "The resource could not be loaded because the App Transport Security policy requires the use of a secure connection." UserInfo={NSErrorFailingURLStringKey=http://reactivetest.apiary.io/subscribers, NSLocalizedDescription=The resource could not be loaded because the App Transport Security policy requires the use of a secure connection., NSErrorFailingURLKey=http://reactivetest.apiary.io/subscribers}}, NSErrorFailingURLStringKey=http://reactivetest.apiary.io/subscribers, NSErrorFailingURLKey=http://reactivetest.apiary.io/subscribers, AFHTTPRequestOperation=<AFHTTPRequestOperation: 0x7fba40e2b290, state: isFinished, cancelled: NO request: <NSMutableURLRequest: 0x7fba40e26470> { URL: http://reactivetest.apiary.io/subscribers }, response: (null)>, NSLocalizedDescription=The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.}

出现这个错误的原因在xcode7的info.plist 里面添加

  • NSAppTransportSecurity类型Dictionary
  • NSAppTransportSecurity下添加NSAllowsArbitraryLoads类型Boolean,值设为YES

你可能感兴趣的:(Xcode7适配)