我不断收到这个错误在我的代码它说价值的类型UIView没有成员。类型UIView的值没有成员错误
这是代码。
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell: CellLemon = tableView.dequeueReusableCellWithIdentifier("Cell") as! CellLemon
cell.cellTopLabel.text = CarMake[indexPath.row]
cell.cellBottom.text = CarModel[indexPath.row]
var imageName = UIImage(named: CarImage[indexPath.row])
cell.cellImage.image = imageName
// Configure the cell...
return cell
}
有问题的代码是这样的,
cell.cellImage.image = imageName
这里是cellLemon类。就是你们要求的。
import UIKit
class CellLemon: UITableViewCell {
@IBOutlet weak var cellImage: UIView!
@IBOutlet weak var cellTopLabel: UILabel!
@IBOutlet weak var cellBottom: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
}
可以显示控制台错误reprort –
这并不是说在控制台东西。 @ Anbu.Karthik –
请显示'CellLemon'类,以及您在哪里注册了单元格 – anhtu