由于以下两个错误,我的构建失败
- ExploreCollectionViewCell 类型的值没有成员“imageView”
- 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
}
最佳答案
ExploreCollectionViewCell 应该具有如下代码所示的属性:
class ExploreCollectionViewCell: UICollectionViewCell {
@IBOutlet weak var imageView: UIImageView!
@IBOutlet weak var titleLabel: UILabel!
...
}
关于xcode - 类型 'CollectionViewCell' 的值没有成员 'imageView',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35237296/