我想在UICollectionViewCell中使用多個標識符。
但似乎我只能爲CollectionView設置一個重用標識符。在UICollectionViewCell中使用多個標識符
[collectionView registerClass:[CollectionViewCell class] forCellWithReuseIdentifier:@"CollectionViewCell"];
這真的只用一個標識工作,但是當我使用不同的標識符這樣的,它提供了錯誤信息。
CollectionViewCell *cell = (CollectionViewCell *)[collectionView dequeueReusableCellWithReuseIdentifier:@"NewID" forIndexPath:indexPath];
終止應用程序由於未捕獲的異常 「NSInternalInconsistencyException」,原因:「無法出列的視圖種 :UICollectionElementKindCell具有標識符 CollectionViewCell - 必須註冊標識符的筆尖或一類 或連接故事板中的原型單元格'
如何在UICollectionViewCell中設置多個標識符?
我想同時顯示多個自定義單元格。
每個單元格都有UIScrollView和UIPageControl。
除非我可以設置不同的標識符,否則該實例將被重新用於新單元,並且UIPageControl不會被每個UIScrollView中的移動所反應。
您是否嘗試註冊其他類/標識符? – nhgrif