Search code examples
iosobjective-cuiimagensdata

data type issue with image URL


I'm sure this is an easy fix, but I can't seem to work it out...

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.

My error is "incompatible pointer types sending UIImage to parameter type NSString.."

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

enter image description here


Solution

  • cell.imageView.image = image;

    https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UIImage_Class/#//apple_ref/occ/clm/UIImage/imageNamed: