以下のコードを使用して既存のプロジェクトにiCarouselを追加しようとしていますが、次のエラーが発生します。MemberCatalog[14990:1a903] -[MainViewController carousel:viewForItemAtIndex:reusingView:]: unrecognized selector sent to instance 0xa0589b0.
エラーをスローするiCarousel.mの行は次のとおりです。view = [_dataSource carousel:self viewForItemAtIndex:index reusingView:[self dequeueItemView]];
どんな助けでもそれは本当に感謝するでしょう。
carouselItems = [NSArray arrayWithObjects:
[UIImage imageNamed:@"iLibrary+Featured_AM-RAH.png"],
[UIImage imageNamed:@"iLibrary+Featured_CCA.png"],
[UIImage imageNamed:@"iLibrary+Featured_GI-PA.png"],
nil];
// Initialize and configure the carousel
carousel = [[iCarousel alloc] initWithFrame:self.view.bounds];
carousel.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
carousel.type = iCarouselTypeCoverFlow2;
carousel.delegate = self;
carousel.dataSource = self;
[self.view addSubview:carousel];
- (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index
{
UIImage *image = [carouselItems objectAtIndex:index];
UIButton *button = [[[UIButton alloc] initWithFrame:CGRectMake(0, 0, image.size.width, image.size.height)] autorelease];
[button setBackgroundImage:image forState:UIControlStateNormal];
[button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
button.titleLabel.font = [button.titleLabel.font fontWithSize:50];
button.tag=index;
return button;
}