-1
我試圖刪除第一個集合視圖單元格。我無法在集合視圖中獲取第一個項目的indexPath。這是我到目前爲止。從集合視圖中刪除特定單元格
-(void)removeFirstItemFromCollectionView
{
NSLog(@"%i", [self.hostQueue count]);
[self.collectionView performBatchUpdates:^{
NSIndexPath * firstIndexPath = [self.collectionView indexPathForCell:(CollectionViewCell *)[self.collectionView viewWithTag:0]];
NSArray *indexPaths = @[firstIndexPath];
//delete item from hostQueue
[self.hostQueue removeObjectAtIndex:0];
// Now delete the items from the collection view.
[self.collectionView deleteItemsAtIndexPaths:indexPaths];
} completion:nil];
}
我越來越崩潰有:
NSIndexPath * firstIndexPath = [self.collectionView indexPathForCell:(CollectionViewCell *)[self.collectionView viewWithTag:0]];
在我的數據源我設置單元格的標籤等於indexPath.row。我想這不起作用?我應該如何獲得第一個indexPath? 謝謝。
這是賓果遊戲! – Andy 2015-02-24 20:01:09