所以我构建检索数据的方式是:
struct framePic {let imagedB:Data!让priceB:String! }
我设法检索数据,但我不知道如何在tableView上设置图像?我已经设法用标签弄清楚了......但不是用图像?
这是表格中单元格的代码;
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell: RowCellTableView = myTableView.dequeueReusableCell(withIdentifier: "cell") as! RowCellTableView
// sets label
cell.priceView.text = framePics[indexPath.row].pricedB
// set image on UIimageView???
--- I dont know how to add this? I need somehow to get the list of only the images??? I believe if I had the array variable like; imageFiles[] I could have done;
imageFiles[indexPath.row].getDataInBackground... But in my case I use struct so how am I supposed to do this in this case?
RowCellTableView只包含;
@IBOutlet弱var imageView:UIImageView! @IBOutlet弱变价查看:UILabel!
2 回答
在您的结构中,您有:
尝试将imagedB转换为UIImage,如下所示:
所以你的实现将是这样的: