dequeueReusableCellWithReuseIdent
全部标签 我正在尝试使用Storyboard中的UICollectionView原型(prototype)单元,就像我们对UITableView所做的那样。但是collectionView.dequeueReusableCellWithReuseIdentifier(:,forIndexPath:)应用程序崩溃并抛出错误***Terminatingappduetouncaughtexception'NSInvalidArgumentException',reason:'mustpassavalidreuseidentifierto-[UICollectionViewdequeueReusable
当我在模拟器中运行我的应用程序时,我遇到了这个运行时错误。Terminatingappduetouncaughtexception'NSInternalInconsistencyException',reason:'couldnotdequeueaviewofkind:UICollectionElementKindCellwithidentifierPlayingCard-mustregisteraniboraclassfortheidentifierorconnectaprototypecellinastoryboard'它崩溃的行是UICollectionViewCell*cell
我有一个UICollectionView,我正在使用dequeueReusableCellWithReuseIdentifier来重用单元格。第二次调用cellForItemAtIndexPath时,将返回一个隐藏的单元格-因此该单元格不会显示在我的UICollectionView中。我尝试对单元格进行硬编码以使其不被隐藏-但这不起作用,并且隐藏属性即使在将其设置为“否”后仍保持"is"。是什么导致单元格被隐藏-如何消除这种情况?-(UICollectionViewCell*)collectionView:(UICollectionView*)collectionViewcellFor
在collectionView(collectionView:UICollectionView,layoutcollectionViewLayout:UICollectionViewLayout,sizeForItemAtIndexPathindexPath:NSIndexPath)->CGSize中调用dequeueReusableCellWithReuseIdentifier时应用崩溃。注意:这个问题不是重复的,因为dequeueReusableCellWithReuseIdentifier在UICollectionView的其他地方工作,只是不在特定函数内。没有异常消息,Xcod
我正在开发一个有UICollectionView的应用程序。我创建了一个包含UIImageView和UILabel的自定义CollectionViewCell。以下代码导致cellForItemAtIndexPath方法中的UICollectionView.dequeueReusableCellWithReuseIdentifier出现EXC_BAD_ACCESS(code=1,address=0x0)错误。这是我的代码:importUIKitclassCategoryCell:UICollectionViewCell{@IBOutletvarcategoryImageView:UII
为UICollectionView创建单元格时,dequeueReusableCellWithReuseIdentifier不通过init也不initWithCoderCategoryView的功能.View正在创建,它有一个正确的类型(CategoryView)但是init也不initWithCoder的CategoryView未被调用,因此基本功能未执行。这个senario中还有其他一些init吗?-(CategoryView*)collectionView:(UICollectionView*)cvcellForItemAtIndexPath:(NSIndexPath*)inde
在UICollectionViewCell类中有几个关于niloutlet的帖子,例如this和this,但没有一个解决方案有效。使用强导出而不是弱导出失败,registerClass解决方案不适用,因为单元不使用自定义XIB,数据源和委托(delegate)正确连接等。在这种情况下,outlet是一个UIImageView,在UICollectionViewCell类内部访问时为nil,但在外部访问时工作正常。UICollectionView代码:funccollectionView(collectionView:UICollectionView,cellForItemAtIndex
在我的项目中,我有多种类型的UITableview单元格,每个单元格都包含UICollectionview。最初我在UITableview的2个部分加载了2个tableViewcell。起初它加载正常没有任何问题。如果我滚动第一部分,它会很好地滚动,但是当我尝试滚动第二部分时,它会出现以下错误:thecellreturnedfrom-collectionView:cellForItemAtIndexPath:doesnothaveareuseIdentifier-cellsmustberetrievedbycalling-dequeueReusableCellWithReuseIden