【发布时间】:2017-01-07 23:47:20
【问题描述】:
将表格单元格的图像设置为我的“图片”时,我看到此代码中的错误。
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "foodcell") as! FoodTableCell
let restaurant: CKRecord = restaurantArrayList[indexPath.row]
cell.name?.text = restaurant.value(forKey: "Name") as? String
cell.picture?.image = restaurant.value(forKey: "Picture") as? CKAsset
//the error is here ^
return cell
如何成功地将“图片”键设置为单元格中的图像?
【问题讨论】:
标签: swift image uitableview cloudkit