2012-06-28 5 views
0
나는 iCarousel을 시도하고

, 나는 그것을 삭제하고있어 뷰의 인덱스와 배열의 인덱스를 삭제하는 기능,이있는 NSMutableArray 마지막 객체

NSInteger index = carousel.currentItemIndex; 
[carousel removeItemAtIndex:index animated:YES]; 
[imagesArray removeObjectAtIndex:index]; 

있다 그것의 사본을 삽입하고 싶습니다. 시도 :

insertItemAtindex:carousel.currentItemIndex 마지막보기가 삽입됩니다.

하지만 내가 원했던 것은 내보기에 carousel의/imagesArray 마지막 개체/색인을 삽입하는 것입니다. 어떻게 구현할 수 있습니까? 뷰에 남아있는 NSMutableArray의 마지막 객체를 어떻게 확인할 수 있습니까?

답변

3

다음을 사용하여 마지막 개체를 확인할 수 있습니다 -

int count = [yourArray count]; 
[yourArray objectAtIndex:count - 1]; //this will always return you last object 
+0

조금 설명해 주시겠습니까? – Bazinga

+1

그냥 다음과 같이하십시오 :'lastObject = [yourArray objectAtIndex : ([yourArray count] -1)]' – pasawaya

+0

@qegal - 같은 것 : – rishi

9

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