2016-03-15 128 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;