을 삭제하는 방법 indexpath.row
on click
나누었다을 찾을 수 있습니다
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
[array removeObjectAtIndex:indexPath.row];
[self.colleVIew deleteItemsAtIndexPaths:[NSArray arrayWithObject:indexPath]];
}
array
이 numberOfItemsInSection
에서 사용되는지 확인하십시오. 그러면 dataSource
가 다시로드됩니다.
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
return [yourArray count];
}
-(void)chat:(int)i
{
NSLog(@"index path%d",i);
[yourArray removeObjectAtIndex:i];
// array object is getting removed,how to delete the CollectionviewCell
[self.collectionView reloadData];
}
'사용하여 다시 시도 data' 또는'reloadItemsAtIndexPath' –