I am having trouble getting an image to load from a URL. I have CollectionViewCell
subclass with an image view setup like this:
@property (strong, nonatomic) IBOutlet UIImageView *albumCover;
I cannot get it to load images from a URL. Here is the code im using:
NSData * imageData = [[NSData alloc] initWithContentsOfURL: [NSURL URLWithString: song.albumURL]];
cell.albumCover = [[UIImageView alloc] initWithImage:[UIImage imageWithData: imageData]];
Meanwhile, this works:
cell.albumCover.image = [UIImage imageNamed:@"lock.png"];
I know the URL connection is getting the proper image back because I am monitoring it with Fiddler. Why isn't the image showing up then?