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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:31:49+00:00 2026-06-14T13:31:49+00:00

I have setup a uitableview with custom cells. I would like these into sections

  • 0

I have setup a uitableview with custom cells.

I would like these into sections with a title. Looking at the below photo I am looking for the following layout:

Section – My Profile
Custom cell – wwwwwwwwwwwwww…
Section – Application
Custom cell – Games
Custom cell – Share
Custom cell – Rate
Custom cell – Settings
Custom cell – Help
Custom cell – Log out

I can see how to add a section and control the rows in a section, but this duplicates the cells into multiple sections, I am not sure how to have one section with one row and another section with 6 rows. I also want to style these sections to show, slightly like the Facebook menu style.

Should I create custom cells for the actual sections instead and have no action on the section (cell) selection?

Here is the code for the UITableView

static NSString *CellIdentifier = @"Cell";
LeftMenuTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

if (cell == nil) {

    NSArray* views = [[NSBundle mainBundle] loadNibNamed:@"LeftMenuTableViewCell" owner:nil options:nil];

    for (UIView *view in views) {
        if([view isKindOfClass:[UITableViewCell class]]) {
            cell = (LeftMenuTableViewCell*)view;


        }
    }
}

enter image description here

  • 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-14T13:31:50+00:00Added an answer on June 14, 2026 at 1:31 pm

    You could define number of sections and rows in it as following:

    - (UIView *) tableview:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section 
    {
        UIView view;
        if(section == 0) {
             // Initialise view for section 1
        } else {
             // Initialise view for section 2
        }
    }
    
    -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
    {
        return 2;
    }
    
    -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
    {
    
        return ((section == 0) ? 1 : 6);
    }
    
    -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
    {
        // return appropriate cell(s) based on section
        if(indexPath.section == 0) 
        {
            // Return 1 cell
        }
        else if(indexPath.section == 1) 
        {
            switch(indexPath.row) {
                case 0: // Initialize cell 1
                        break;
                case 1: // Initialize cell 2
                        break;
                ...
            }
        }
        return cell;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a setup with sections in a UITableView which all have a custom
I have a UITableView populated with custom UITableViewCells. Within those custom cells, I have
I just have a quick best practice question regarding custom cells in a UITableView.
Following the documentation on custom cells from a NIB (the Dynamic option), I have
I have a UITableView with custom cells. Inside each cell is 2 views. Each
I have setup Custom Domain https://developers.google.com/appengine/docs/domain I have uploaded An SSL certificate and private
I have a grouped UITableView, with cells in section 2 depending on cells in
I would like to know where to enter custom code to change the value
I have made major changes and setup a custom class for the TableView Cell.
I have a UITableview setup in my iphone app. At the moment, each row

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.