Error Domain=NSURLErrorDomain Code=-1022 "The resource could not be loaded because the App Transport Security policy requires the use of a secure connection."
这是因为Xcode 7以后,苹果要求所有的网络请求都是安全的(HTTPS).所有如果本身的服务器不支持HTTPS请求的话就要修改Xcode的默认配置.
在info.plist文件中,添加类型为Dictionary的NSAppTransportSecurity,在NSAppTransportSecurity下添加Boolean类型的NSAllowsArbitraryLoads,值设为YES