2016-03-15 96 views
1

我敢肯定,這是一個簡單的辦法,但我似乎無法工作了......數據類型的問題

group[PF_GROUP_FEATURED] is just a database reference to a URL. I am trying to get these images to show up in my tableView cells. 

我的錯誤是「不兼容的指針類型發送到UIImage的參數鍵入的NSString ..」

UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:group[PF_GROUP_LOGO]]]]; 
    cell.imageView.image = [UIImage imageNamed:image]; 

enter image description here

+0

您能向我們展示您的小組[PF_GROUP_FEATURED]的定義嗎?看起來這是一個圖像,而不是一個字符串? – Shripada

+0

鏈接是存儲在我的數據庫中的字符串。它是一個名爲Logo的字符串(我曾作爲一個錯字,我修正了它,但它並沒有解決我的問題) –

+1

'cell.imageView.image = image;'not'cell.imageView.image = [UIImage imageNamed:image] ;' –

回答

4

cell.imageView.image = image;