NSMutableArray最后一个Object

0 nsmutablearray ios icarousel

我正在尝试iCarousel,有一个函数可以删除视图的索引和数组的索引,

NSInteger index = carousel.currentItemIndex;
[carousel removeItemAtIndex:index animated:YES];
[imagesArray removeObjectAtIndex:index];
Run Code Online (Sandbox Code Playgroud)

我删除它直到剩下一个项目,然后如果剩下一个项目我想插入它的副本.我试过这个:

insertItemAtindex:carousel.currentItemIndex 但它正在插入最后一个视图.

但我想要的是在我的视图中插入carousel的/ imagesArray最后一个对象/索引.我该如何实现它,或者如何确定NSMutableArray在视图中留下的最后一个对象?

Ste*_*mer 9

carousel.lastObject !!!!!!!!!!