Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在UITableView iPhone中显示MySQL数据库中的图像_Iphone_Mysql_Uitableview_Image_Uiimageview - Fatal编程技术网

在UITableView iPhone中显示MySQL数据库中的图像

在UITableView iPhone中显示MySQL数据库中的图像,iphone,mysql,uitableview,image,uiimageview,Iphone,Mysql,Uitableview,Image,Uiimageview,我在MySQL数据库中以BLOB格式存储了一些图像数据, 我获取字符串和整数数据,但对于图像,它不显示。 我还尝试使用UIImageView,但它不起作用 是否有人可以发布一些代码以在UITableView中显示图像数据。 NSData-->UIImage-->图像显示 感谢提供了一个NSData对象数据,其中数据是UIImage支持的图像类型(PNG、JPG等) 获得图像后,将其添加到UITableViewDataSource的表视图:cellForRowAtIndexPath: [[cell

我在MySQL数据库中以BLOB格式存储了一些图像数据, 我获取字符串和整数数据,但对于图像,它不显示。 我还尝试使用
UIImageView
,但它不起作用

是否有人可以发布一些代码以在
UITableView
中显示图像数据。
NSData
-->
UIImage
-->图像显示


感谢

提供了一个NSData对象
数据
,其中数据是UIImage支持的图像类型(PNG、JPG等)

获得图像后,将其添加到UITableViewDataSource的
表视图:cellForRowAtIndexPath:

[[cell imageView] setImage: image];

在数据库获取结果后,我对(NSDictionary*结果中的行){[tableData addObject:[row objectForKey:@“imgdata”]];}和表视图方法[cell.imageView setImage:[tableData objectAtIndex:index]]执行了操作;您可以解释将代码放在何处您可以将其放在任意位置,但您需要将[row objectForKey:@“imgdata]”(即原始数据)转换为UIImage。我把它作为[tableData addObject:image]放在数据库获取例程中。谢谢你的回复。如何将原始数据转换为图像??你能用一段代码解释一下吗。。。
[[cell imageView] setImage: image];