无法获取HTTP的图片资源

项目中加载微信的头像为http的开头的图片资源.
xcode报错

The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.

在info.plist文件中添加

NSAppTransportSecurity

    NSExceptionDomains
    
        yourdomain.com
        
            NSExceptionAllowInsecureHTTPLoads
            
            NSExceptionRequiresForwardSecrecy
            
            NSIncludesSubdomains
            
            NSTemporaryExceptionAllowsInsecureHTTPLoads
            
        
    
    NSAllowsArbitraryLoadsInWebContent
    
    NSAllowsArbitraryLoads
    

    yourdomain.com //输入图片的域名即可

你可能感兴趣的:(无法获取HTTP的图片资源)