我正在使用storyboard在UITableView上创建一个自定义单元格,并将每个元素分配给class.But当我运行该项目时,它说:
必须将自动调整遮罩转换为约束才能使_setHostsLayoutEngine:YES。
这是我的代码:
var image : UIImage = UIImage(named: foodImages[indexPath.row])!
let cell = tableView.dequeueReusableCellWithIdentifier("timelineCell", forIndexPath: indexPath) as! UITableViewCell
let object = dataArray[indexPath.row] as NSDictionary
(cell.contentView.viewWithTag(1) as! UIImageView).image = image
(cell.contentView.viewWithTag(2) as! UILabel).text = object["firstName"] as? String
(cell.contentView.viewWithTag(4) as! UIImageView).image = UIImage(named: "des5.jpg")
return cell
我收到了错误:
let cell = tableView.dequeueReusableCellWithIdentifier("timelineCell", forIndexPath: indexPath) as! UITableViewCell
我该如何解决?