jjzjj

PhotoCollectionViewCell

全部标签

ios - 寄存器有什么问题(_ :forCellWithReuseIdentifier:) on UICollectionView?

我正在使用UICollectionView。正如dequeueReusableCell(withReuseIdentifier:for:)所期望的那样,在调用此方法之前,您必须使用register(_:forCellWithReuseIdentifier:)方法注册一个类或nib文件方法,我在我的viewDidLoad函数中添加了一行asself.collectionView!.register(PhotoCollectionViewCell.self,forCellWithReuseIdentifier:reuseIdentifier)现在,当我使用单元格进行出队和配置时,我遇到了错