iCarousel滚动在swift中不起作用

时间:2016-04-22 06:45:44

标签: ios swift icarousel

我正在处理类型为“iCarouselTypeCoverFlow2”的icarousel。我正在使用Label显示其中的名称。因为我使用以下方法

func carouselDidEndScrollingAnimation(carousel: iCarousel) {

         print(carousel.currentItemIndex)
        namesLabel.text = self.godsNamesArray.objectAtIndex(carousel.currentItemIndex) as? String

  }

我在这个方法中遇到的问题是

   In that I am printing the “carousel.currentItemIndex”.
For the first time it is printing the currentItemIndex is”0”
For the second time it is printing the currentItemIndex is ”-1”
That’s why the app is getting crash with the following error
  

- [__ NSArrayM objectAtIndex:]:索引18446744073709551615超出界限[0 .. 5]'

任何人都可以帮我解决这个问题。我在这里做的错误是什么。 在此先感谢。

0 个答案:

没有答案