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

  • Home
  • SEARCH
  • 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 6338923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:32:39+00:00 2026-05-24T19:32:39+00:00

i have 60 rows in an table view.i have an array named as BundleImagesArray

  • 0

i have 60 rows in an table view.i have an array named as “BundleImagesArray ” with 60 bundle images names.So i am retrieving the images from bundle and creating thumbnail to it.
whenever binding each cell at first time ,i am storing the Thumbnail images in to an array.because of enabling the fast scrolling after bind each cell.i am utilizing the images from the array(without creating the thumbnail again).however the imageCollection array(which will store thumbnail images) is disorder some times

the Index path.row is coming as 1,2…..33,34,50,51..etc

its not an sequential order.so i am getting trouble with my imageCollection array which is used to store and retrieve images according to the index path.may i know what is the reason for that.can any one provide me a good solution for this.is there any way to get the indexpath.row as sequential order?

my cellForRowAtIndexPath code is:

 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {    

     NSLog(@"IndexPath Row%d",indexPath.row);
     static NSString *CellIdentifier = @"Cell";

     UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
     if (cell == nil)
     {

      cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
     }    


     if ([cell.contentView subviews])
     {
      for (UIView *subview in [cell.contentView subviews])
      {
       [subview removeFromSuperview];
      }
     }

     cell.selectionStyle = UITableViewCellSelectionStyleNone;
     [cell setAccessoryType:UITableViewCellAccessoryNone];

     Class *temp = [BundleImagesArray objectAtIndex:indexPath.row];

     UIImageView *importMediaSaveImage=[[[UIImageView alloc] init] autorelease];
     importMediaSaveImage.frame=CGRectMake(0, 0, 200,135 );
     importMediaSaveImage.tag=indexPath.row+1;
     [cell.contentView addSubview:importMediaSaveImage]; 
     UILabel *sceneLabel=[[[UILabel alloc] initWithFrame:CGRectMake(220,0,200,135)] autorelease];

     sceneLabel.font = [UIFont boldSystemFontOfSize:16.0];
     sceneLabel.textColor=[UIColor blackColor];
     [cell.contentView addSubview:sceneLabel];


    //for fast scrolling
       if([imageCollectionArrays count] >indexPath.row){


        importMediaSaveImage.image =[imageCollectionArrays ObjectAtIndex:indexPath,row];
     }
     else {

//for start activity indicator 
      [NSThread detachNewThreadSelector:@selector(showallstartActivityBundle) toTarget:self withObject:nil];
      NSData *datas = [self photolibImageThumbNailData:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:temp.fileName ofType:@"png" inDirectory:@"Images"]]];

      importMediaSaveImage.image =[UIImage imageWithData:datas]; 

      [imageCollectionArrays addObject:importMediaSaveImage.image];



//to stop activity indicator
      [NSThread detachNewThreadSelector:@selector(showallstopActivityBundle) toTarget:self withObject:nil];
     }





     sceneLabel.text = temp.sceneLabel;

     temp = nil;
     return cell;
    }
  • 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-05-24T19:32:41+00:00Added an answer on May 24, 2026 at 7:32 pm

    An NSArray is perfectly fine for UITableView rows. The rows are ordered, and an array is also ordered, so no problem there.

    The problem in your code seems to be that you are using two arrays, one immutable and one mutable. You are adding objects to the mutable array, and so it is not exactly predictable where they will be added (because it is not predictable that the rows are going to be needed in order).

    I recommend filling your NSMutableArray first with [NSNull null] objects, and then inserting the image at a specific point in the array:

    // during initialization 
    for (int i=0; i<numberOfImages; i++) {
        [imageCollectionArrays addObject:[NSNull null]];
    }
    
    // in cellForRowAtIndexPath:
    [imageCollectionArrays replaceObjectAtIndex:indexPath.row 
        withObject:importMediaSaveImage.image];
    

    Try that, see if it works.

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

Sidebar

Related Questions

I have table rows of data in html being filled from a CGI application.
I have two identical tables and need to copy rows from table to another.
I have a website that lets people view rows in a table (each row
I have an array of folders. Each folder is listed as a table view
I'm trying to delete a row from my table view and so far have
I have multiple rows in a table, in one of which is a link
I have 1 million rows in MySql table temp and wish to multiply column
i have some rows of data displayed in a table and on mouse over
I have two functions to add and remove table rows that contain a form
I have a table with a column 'A'. Some rows have 14 digits for

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.