[cell.imageView setImageWithURL:[NSURL URLWithString:str] placeholderImage:[UIImage imageNamed:@"Icon.png"] completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
NSLog(@"%@",error);
}];
無法顯示請求圖片,只顯示 placeholderImage圖片;
原因:iOS9以後,http協議改成了https協議,所以不能直接在http協議下GET/POST
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
NSString * str1 = @「http」
NSString * str2=[str1 stringByReplacingOccurrencesOfString:@"http" withString:@"https"];