0
我試圖在_myMusicCollectionView中插入一個新單元格。數據源是SharedAppDelegate.myMusics數組:嘗試插入新單元格時UICollectionView中的NSInternalInconsistencyException
[_myMusicsCollectionView performBatchUpdates:^{
[SharedAppDelegate.myMusics addObject:c.item];
[_myMusicsCollectionView insertItemsAtIndexPaths:[[NSArray alloc] initWithObjects:[NSIndexPath indexPathForRow:SharedAppDelegate.myMusics.count-1 inSection:0], nil]];
} completion:^(BOOL finished) {
[_musicStoreCollectionView reloadItemsAtIndexPaths:[[NSArray alloc] initWithObjects:indPath, nil]];
}];
我越來越:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'request for index path for global index 805306367 when there are only 1 items in the collection view'
我在哪裏錯了?
是的,我明白了。我想知道我應該在哪裏插入新項目,以及何時執行更新? – Burak