I’m using a iCarousel, if you haven’t seen the iCarousel,its an open source project at github: iCarousel
This is how I remove my object at my iCarousel :
NSInteger index = carousel1.currentItemIndex;
[carousel1 removeItemAtIndex:index animated:YES];
[items1 removeObjectAtIndex:index];
It says in the methods included in the project that:
- (void)removeItemAtIndex:(NSInteger)index animated:(BOOL)animated;
This removes an item from the carousel. The remaining items will slide
across to fill the gap. Note that the data source is not automatically
updated when this method is called, so a subsequent call to reloadData
will restore the removed item.
So what I wanted to do Is whenever I remove an item at that index, I want to replace with a [NSNull null] or a dummy object, that can’t be seen in the iCarousel to remain the index count of the array. But in my project it seems to be crashing. So I think it isn’t possible.
So what I wanted to is update its array or replace an object inside my NSMutableArray.
When you perform the
Remove the object from the array before reloading the data. So in that case, your array count remains correct