jjzjj

arrayWithIndexPaths

全部标签

ios - 动态添加内容到 UICollectionView

我有一个由Web服务支持的UICollectionView。我最初将服务中的100个项目加载到CollectionView中。当用户到达View底部时,我会动态加载下一个“页面”内容。这是可行的,但我的collectionView闪烁并从顶部重新绘制整个View。我试图让它开始在View底部绘制新内容。向CollectionView添加新内容的代码:-(void)insertIntoCollectionView:(int)itemCnt{//onlydothebatchupdateforNON-initialloadif(curPage!=0){//Additemstomainphot

ios - Collection View performBatchUpdates 崩溃

我正在尝试使用insertItemsAtIndexPaths将新项目添加到我的CollectionView中。我的应用程序在performBatchupdate时崩溃-(void)addItems{NSArray*newProducts=@[@"1",@"2",@"3",@"4"];[self.collectionViewperformBatchUpdates:^{NSMutableArray*arrayWithIndexPaths=[NSMutableArrayarray];for(NSIntegerindex=self.array.count;index崩溃日志如下:*Assert