gpt4 book ai didi

xcode - 类型 'CollectionViewCell' 的值没有成员 'imageView'

转载 作者:行者123 更新时间:2023-11-30 13:43:43 24 4
gpt4 key购买 nike

由于以下两个错误,我的构建失败

  1. ExploreCollectionViewCell 类型的值没有成员“imageView”
  2. ExploreCollectionViewCell 类型的值没有成员“titleLabel”

我无法弄清楚是什么更改导致了失败,或者如何在不重做整个项目的情况下修复它。

func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {

let cellApt = collectionView.dequeueReusableCellWithReuseIdentifier("cellApt", forIndexPath: indexPath) as! ExploreCollectionViewCell

cellApt.imageView?.image = self.imageArray[indexPath.row]
cellApt.titleLabel?.text = self.condoCells[indexPath.row]
cellApt.setNeedsLayout()

return cellApt
}

storyboard

最佳答案

ExploreCollectionViewCell 应该具有如下代码所示的属性:

class ExploreCollectionViewCell: UICollectionViewCell {
@IBOutlet weak var imageView: UIImageView!
@IBOutlet weak var titleLabel: UILabel!

...
}

关于xcode - 类型 'CollectionViewCell' 的值没有成员 'imageView',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35237296/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com