Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8996939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:49:17+00:00 2026-06-15T23:49:17+00:00

I am implementing iCarousel (using coverflow type) to show a bunch of images of

  • 0

I am implementing iCarousel (using coverflow type) to show a bunch of images of some videos that are available in my app. (2 seperate carousels, same problem)

I use the arrays of videos for the numberOfItemsInCarousel (currently 60) and viewForItemAtIndex to use the objects from my array to build out the view.

However, only 5 of the videos are being used. So 60 items are showing up in the carousel, but its just the same 5 items being repeated. When I logged the index inside of the ‘viewForItemAtIndex’, it only gets called 5 times (0,1,…5 are the log results).
After some testing, it seems that the only indexes being called are for whatever is visible in the carousel by default.

What gives?
*The arrays have been tested to ensure they are populated with all unique videos. The array is fine, its something to do with the iCarousel method.

- (NSUInteger)numberOfItemsInCarousel:(iCarousel *)carousel{
    if(carousel==freeCarousel){
        NSLog(@"Free: %i",freeVideos.count);
        return freeVideos.count;
    }
    if(carousel==feeCarousel){
        NSLog(@"Fee: %i",feeVideos.count);
        return feeVideos.count;
    }
    return 0;
}
- (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index reusingView:(UIView *)view{
    NSLog(@"TESTING");
    if (view == nil){
        //Copy array for easier use of global Video / File object
        NSArray *copy = [[NSArray alloc] init];
        if(carousel==freeCarousel){
            copy = [NSArray arrayWithArray:freeVideos];
        }
        else if(carousel==feeCarousel){
            copy = [NSArray arrayWithArray:feeVideos];
        }

        Videos *currentVideo = [copy objectAtIndex:index];
        Files *file = [currentVideo valueForKey:@"files"];
        NSLog(@"TITLE TEST: %@",currentVideo.title);
        //Video Button
        UIButton *buttonVideo = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 465, 310)];
        [buttonVideo setTag:[currentVideo.videoID intValue]];
        [buttonVideo addTarget:self action:@selector(showVideoDetails:) forControlEvents:UIControlEventTouchUpInside];

        //Thumbnail
        UIImageView *videoThumbnail = [[UIImageView alloc] initWithFrame:buttonVideo.bounds];
        //Border
        [videoThumbnail setBackgroundColor:[UIColor whiteColor]];

        //Caption
        UIImage *captionImage = [UIImage imageNamed:@"video-box-caption"];
        UILabel *caption = [[UILabel alloc] initWithFrame:CGRectMake(0, videoThumbnail.frame.size.height-captionImage.size.height, videoThumbnail.frame.size.width, captionImage.size.height)];
        ];
        ;
        ];
        ];
        ;
        [videoThumbnail addSubview:caption];

        if(file.thumbnailPath!=(id)[NSNull null] || ![file.thumbnailPath isEqualToString:@"missing_image.png"]){
            UIImage *thumbnailImage = [[DataManager sharedManager] generateThumbnailImage:currentVideo];
            [videoThumbnail setImage:thumbnailImage];
            [buttonVideo addSubview:videoThumbnail];
        }else{
            UIImage *thumbnailImage = [UIImage imageNamed:@"video-details-thumbnail"];
            [videoThumbnail setImage:thumbnailImage];
            [buttonVideo addSubview:videoThumbnail];
        }
        view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, buttonVideo.frame.size.width, buttonVideo.frame.size.height)];
        [view addSubview:buttonVideo];
    }
    return view;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T23:49:17+00:00Added an answer on June 15, 2026 at 11:49 pm

    You’ve implemented the viewForItemAtIndex method wrong.

    iCarousel recycles views to avoid allocating new objects while moving (like a UITableView). The if (view == nil) check is saying “if view is nil create a new view, otherwise use a view I’ve already set without modifying it).

    Move any index-specific logic outside of the if (if view == nil) check. If you look at the iCarousel examples included with the library, it shows how to do this correctly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I implementing iCarousel in my app for a CoverFlow. I can't find method for
Before implementing j_security_check using MySQL realm authentication in my web app. I had the
While implementing my own IFilter I found that most likely some consumers will require
I am implementing iCarousel in my app but somehow can't figure out which view
Implementing a PhoneGap app for Android and iOS, the app is using Facebook Connect
When implementing a factory or simple factory, what would go against using a Type
Iam implementing facebook and twitter using sharekit for an iphone app. How can we
implementing publishActivity in PHP using the REST API using this code: $activity = array(
Implementing a custom membership provider, there are certain properties such as MinRequiredPasswordLength that only
Implementing a simple Login screen using JSF and Spring and Hibernate. I have written

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.