2017-02-21 47 views
-3
NSURL *url = [NSURL URLWithString:[self.imageArray objectAtIndex:indexPath.row]]; 
NSLog(@"My URL : %@",url); 

NSData *data = [NSData dataWithContentsOfURL:url]; 
NSLog(@"New Data : %@",data); 

UIImage *tmpImage = [[UIImage alloc] initWithData:data]; 

cell.imageView.image = tmpImage; 
+0

当您调用该方法时,nslog会打印什么? –

+0

它打印空数据新数据:空,但url nslog获取数据? –

+0

你可以上传你的网址给我测试吗? –

回答

0

enter image description here

enter image description here

我想我得到了你的问题,检查这就像在你的项目我上传图片获取数据。

我也做了一个gif关于如何在你的项目中添加这个设置,只需按照我的gif中的步骤。

enter image description here

+0

谢谢兄弟..现在工作得很好。 –

+0

不客气。 –