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 6575497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:23:38+00:00 2026-05-25T15:23:38+00:00

I need to implement the abcd list indexing in the below table view right

  • 0

I need to implement the abcd list indexing in the below table view right side.when i am clicking on a/b/c etc table view need to show the entries according to that for sorting like iphone contacts .may i know what are all
the changes i need for it.is need to create sections for that?please any one explain me
any solution.

I have an class named as “myClass” which contains the properties iD, name and imageURL.

image url holds the photolibrary alasset url.

myClass.h

@interface myClass: NSObject {
    NSInteger iD;
    NSString *name;
    NSString *imageURL;
}

@property (nonatomic, assign) NSInteger iD;
@property (nonatomic, assign) NSString *name;
@property (nonatomic, assign) NSString *imageURL;

myClass.m

@implementation myClass

@synthesize iD;
@synthesize name;
@synthesize imageURL;

@end

So I added 50 image details with iD, name, imageURL as myClass objects in to an NSMutableArray named as *BundleImagesArray *

i displayed it in a table view. my code is:

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger) section {
    //getting all image details with iD,name,imageURL as **myClass** objects     
    BundleImagesArray = [staticDynamicHandler getImageFromBundle];

    int count =  [BundleImagesArray count];

    for (int i = 0; i<count; i++) {
        //this array for easy scrolling after first time the table is loaded.
        [imageCollectionArrays addObject:[NSNull null]];

    }
    return count;

}

cellForRowAtIndexPath

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

    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    }

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

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

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


    //adding image view 
    UIImageView *importMediaSaveImage=[[[UIImageView alloc] init] autorelease];
    importMediaSaveImage.frame=CGRectMake(0, 0, 200,135 );
    [cell.contentView addSubview:importMediaSaveImage]; 

    //adding image label
    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];

    sceneLabel.text = temp.name;

    if([imageCollectionArrays objectAtIndex:indexPath.row] == [NSNull null]){ 

        //getting photlibrary image thumbnail as NSDAta
        NSData *myData = [self photolibImageThumbNailData::temp.imageURL]

        importMediaSaveImage.image =[UIImage imageWithData:myData ];

        [imageCollectionArrays replaceObjectAtIndex:indexPath.row withObject:importMediaSaveImage.image];
    } else {
        importMediaSaveImage.image = [imageCollectionArrays objectAtIndex:indexPath.row];
    }

    temp = nil;
    return cell
}

*Note:*
i done it using the following way
1.Number of sections-
inside this we are getting the label array and then calling the method countArrayWords whihc will count the words and
the alphabets starting from a particular word.
2.Title for headerin section-
Used for gettting the headers for the sections.Currently we are not using this methd as it will not look good when we are having
no data on the table view.
3.number of rows in section-
in this we are calling the method countArrayWords if the sectio=0.
4.cell for row at index path-
this is the method in which we are calculating a variable known as h through which we are using to bind the images to the table
view.
However the Tableview performence is too slow with 1000 images

  • 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-25T15:23:39+00:00Added an answer on May 25, 2026 at 3:23 pm

    An easy way to handle this is to create 2 arrays, one of sections, and another of section titles. You can then populate these from your sorted array of MyClass’es in your init method (initWithObjects: , say)

    - (id) initWithObjects: (NSArray *) myObjectsArray
    {
        self  = [super initWithNibName: <your-nib-name> bundle: nil];
    
        if (self) {
            self.sections = [NSMutableArray array];
            self.sectionTitles = [NSMutableArray array];
    
            for (MyClass * object in self.myObjectsArray) {
                NSMutableArray * section = [self.sections lastObject];
    
                if (!section || ![[[[section lastObject] name] substringToIndex: 1] isEqualToString: [object.name substringToIndex: 1]]) {
                    // Create a new section on change of first character
    
                    [self.sections addObject: [NSMutableArray array]];
                    [self.sectionTitles addObject: [object.name substringToIndex: 1]];
                }
    
                [[self.sections lastObject] addObject: object];
            }
        }
    
        return self;
    }
    

    Then your datasource methods are

    - (NSInteger) numberOfSectionsInTableView:(UITableView *)tableView
    {
        return [self.sections count];
    }
    
    - (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
    {
        return [[self.sections objectAtIndex: section] count];
    }
    
    - (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        //Create cell
    
        MYClass * object = [[self.sections objectAtIndex: indexPath.section] objectAtIndex: indexPath.row];
    
        //Configure cell
    
        return cell;    
    }
    
    - (NSArray *) sectionIndexTitlesForTableView:(UITableView *)tableView
    {
        return self.sectionTitles;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to implement multilevel expandable list view, something like ExpandableListView but with more
I need implement simple search in small content table: id, name, description, content. Results
I need to implement a hash table and hash function using JavaScript. The goal
I need to implement a Diff algorithm in VB.NET to find the changes between
I need to implement version control, even for just the developing I do at
I need to implement a 4-to-1 function in Veriog. The input is 4 bits,
I need to implement auto-capitalization inside of a Telerik RadEditor control on an ASPX
I need to implement an in-memory tuple-of-strings matching feature in C. There will be
We need to implement a simple state machine in C . Is a standard
I need to implement an OpenID Provider in .Net and wondered....Is there's any OpenSource

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.