Beginner iOS dev here. I have a problem in my array. Im making an app with iCarousel. That whenever it stop to a view it will delete the current view or index, like this:
NSInteger index = carousel.currentItemIndex;
[carousel removeItemAtIndex:index animated:YES];
[images removeObjectAtIndex:index];
So my array have an index with this:
0 1 2 3 4 5
when I use the method above ( for example it lands on view 3) it become like this:
0 1 2 4 5
How to remain the same array index/value even if I delete? or should I update it?
I tried using [carousel reloadData]; but still no effect.
Use
[carousel replaceItemAtIndex:index withObject:[NSNull null]];and check if the object is of type
NSNullthen do nothing or according to your requirement.