letcell=collectionView.dequeueReusableCellWithReuseIdentifier("BigRoomVideoCell",forIndexPath:indexPath)asVideoViewCell上面是重用cell的写法,但是如何每次都实例化一个collectionview的cell?我尝试过letcell=VideoViewCell()直接报***Terminatingappduetouncaughtexception'NSInternalInconsistencyException',reason:'thecellreturnedfrom-collectionView:cellForItemAtIndexPath:doesnothaveareuseIdentifier-cellsmustberetrievedbycalling-dequeueReusableCellWithReuseIdentifier:forIndexPath:google了也没找到合适的答案
2 回答
慕村225694
TA贡献1880条经验 获得超4个赞
也试过letcell=collectionView.cellForItemAtIndexPath(indexPath)asVideoViewCell办法,直接报fatalerror:unexpectedlyfoundnilwhileunwrappinganOptionalvalue
POPMUISE
TA贡献1765条经验 获得超5个赞
是否没有注册[_collectionViewregisterClass:[BigRoomVideoCellclass]forCellWithReuseIdentifier:CELL_IDENTIFIER];
添加回答
举报
0/150
提交
取消