我正在显示图像。collection view
我想删除每个项目。button click
现在我可以删除项目didSelect method
。
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
[array removeObjectAtIndex:indexPath.row];
[self.colleVIew deleteItemsAtIndexPaths:[NSArray arrayWithObject:indexPath]];
}
我已经放置CollectionCell
了按钮,可以找到indexpath.row
on click
。但是如何删除
-(void)chat:(int)i
{
NSLog(@"index path%d",i);
[array removeObjectAtIndex:i]; // array object is getting removed,how to delete the CollectionviewCell
}