2017-02-21 41 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

不客氣。 –