无法分配给属性:“图像”是仅获取属性

时间:2019-01-23 13:16:15

标签: swift

import UIKit
class Categorycell: UITableViewCell {
    @IBOutlet weak var categoryImage : UIImage!
    @IBOutlet weak var categoryTitle : UILabel!
    func updateViews(category: category) {
        categoryImage.images = UIImage(named: category.imageName)
        categoryTitle.text = category.title
    }
}

1 个答案:

答案 0 :(得分:1)

尝试更改@IBOutlet weak var categoryImage : UIImage!

@IBOutlet weak var categoryImage : UIImageView!