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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:28:13+00:00 2026-06-03T05:28:13+00:00

I have fairly started with IOS development and am on my first client project.

  • 0

I have fairly started with IOS development and am on my first client project.

I am stuck at the following place:

so if there are 10 people’s birthday this month, i need to display 10 imageviews in a single row (3 pictures, 3 pictures and 1 picture).

Can someone help me with the above. It will be greatly appreciated.

  • 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-03T05:28:15+00:00Added an answer on June 3, 2026 at 5:28 am

    If you want to add images/labels/buttons in tableview, then the simplest way is to subclass UITableViewCell.For Example if you have 5 images(didn’t understand 3 pictures, 3 pictures and 1 picture ) and you want to show them in a table row then you could do something like this:

    1. Add a new file in your project named CustomCell which should be the subclass of UITableviewCell like this:

      @interface CustomCell : UITableViewCell {  
      
          UIImageView *imageView1;  
          UIImageView *imageView2;  
          UIImageView *imageView3;  
          UIImageView *imageView4;  
          UIImageView *imageView5;  
      }  
      @property (nonatomic, retain) UIImageView *imageView1;  
      @property (nonatomic, retain) UIImageView *imageView2;  
      @property (nonatomic, retain) UIImageView *imageView3;  
      @property (nonatomic, retain) UIImageView *imageView4;  
      @property (nonatomic, retain) UIImageView *imageView5;  
      @end  
      
    2. And in CustomCell.m put this code like this:

      @synthesize imageView1, imageView2, imageView3, imageView4, imageView5;
      - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier 
      {
      if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) 
          {           
              self.imageView1 = [[UIImageView alloc] initWithFrame:CGRectMake(10, 8, 50, 45)];
              [self.contentView addSubview:imageView1];
      
              self.imageView2 = [[UIImageView alloc] initWithFrame:CGRectMake(65, 8, 50, 45)];
              [self.contentView addSubview:imageView2];
      
              self.imageView3 = [[UIImageView alloc] initWithFrame:CGRectMake(120, 8, 50, 45)];
              [self.contentView addSubview:imageView3];
      
              self.imageView4 = [[UIImageView alloc] initWithFrame:CGRectMake(170, 8, 50, 45)];
              [self.contentView addSubview:imageView4];
      
              self.imageView5 = [[UIImageView alloc] initWithFrame:CGRectMake(225, 8, 50, 45)];
              [self.contentView addSubview:imageView5];
          }
      
      return self;
      }  
      

    So you are done with subclassing of UITableViewCell.Now how to use them in your view controller?
    You have to import CustomCell.h in your View Controller class.And in the cellForRowAtIndexPath delegate method do some thing like this:

        - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath  
        {  
            static NSString *CellIdentifier = @"Cell";  
    
            //our custom cell  
            CustomCell *cell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];  
            if (cell == nil) {  
                cell = [[CustomCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];  
            }  
    
            // Configure the cell.  
    
            //cell.imageView1.image = [UIImage imageNamed:@"testImg1"];  
            //cell.imageView2.image = [UIImage imageNamed:@"testImg2"];  
            //cell.imageView3.image = [UIImage imageNamed:@"testImg3"];  
            //cell.imageView4.image = [UIImage imageNamed:@"testImg4"];  
            //cell.imageView5.image = [UIImage imageNamed:@"testImg5"];  
            //return cell;  
    

    u could use the better was :

        NSMutableArray *imgArray = [[NSMutableArray alloc] initWithObjects:cell.imageView1, cell.imageView2,cell.imageView3, cell.imageView4, cell.imageView5, nil];
    
        for (int imageCounter = 0; imageCounter<5; imageCounter++) {
            [[imgArray objectAtIndex:imageCounter] setImage:[UIImage imageNamed:[NSString stringWithFormat:@"testImg%d", imageCounter]]];
                }  
    return cell; 
    }
    

    this is the very prototype solution for your problem’s context.
    Hope it would help you 🙂

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

Sidebar

Related Questions

I have a fairly large Excel file. In this file there is a column
I'm fairly new to MVVM, and I have recently started a project cleaning up
I'm fairly new to directx so this may sound really basic. I have started
I have recently started a fairly large web project which is going to use
I am fairly new to .NET C# development and recently started using LINQ to
I have started working on a new Xcode project, a game to be exact.
We have just started our new assignment - web-based project. Before I get directly
I have a fairly complex application at this point, and feel as though the
I am fairly new to .NET development and have just installed a clean install
I'm fairly new to C and have started out writing a small library with

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.