UIImage
不显示图像。我UIImageView
使用以下方法为表格单元格创建了一个自定义类:
imgView = [[UIImageView alloc]init];
frame= CGRectMake(boundsX+10 ,0, 50, 44);
imgView.frame = frame;
然后,我尝试加载每个单元格,但什么也没有。但是,我可以在日志消息中读取图像 url。
NSURL *url = [NSURL URLWithString: [dict objectForKey:@"imageAdd"]];
NSData *data = [NSData dataWithContentsOfURL: url];
UIImage * image = [[UIImage alloc] initWithData:[[data copy] autorelease]];
NSLog (@"The image is located at the URL: %@", url);
cell.imgView.image = image;
return cell;