1.UIImageView加載網(wǎng)絡(luò)路徑時(shí),由于直接明文路徑拭抬,現(xiàn)在不能直接顯示出來(lái)辈灼。
NSURL*url = [NSURLURLWithString:@"http://pica.nipic.com/2007-11-09/200711912453162_2.jpg"];
NSData*data = [NSDatadataWithContentsOfURL:url];
UIImage*image = [UIImageimageWithData:data];
提出錯(cuò)誤:
*Xcode提示:App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.*
2.UIWebView 加載網(wǎng)址的時(shí)候出現(xiàn)如下錯(cuò)誤:
'NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)'
解決辦法:
在Info.plist文件中添加"App Transport SecuritySettings", Type為"Dictionary",再添加"Allow Arbitray Loads", Type 為"Boolean"甫匹,“Value”為“YES”即可傲须。