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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:25:11+00:00 2026-05-24T23:25:11+00:00

I am creating a uitableview that has two sections, section == 0 has 5

  • 0

I am creating a uitableview that has two sections, section == 0 has 5 rows, and section == 1 has 1 row.

I have also declared several functions in an objective-c class that I would like to hook into each of the five rows. However I am not sure how to implement this.

I am thinking it is something like

- (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];
    }

    // Configure the cell...
    cell.selectionStyle = UITableViewCellSelectionStyleNone;

//---------- In here put a bunch of IF statments, declaring each cell? and linking it to
//---------- the function I have declared in the objective-c class

    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-24T23:25:12+00:00Added an answer on May 24, 2026 at 11:25 pm

    Usually the cells are setup in tableView:cellForRowAtIndexPath:. Determining the function that’s called when a cell is tapped is usually done in tableView:didSelectRowAtIndexPath.

    When setting up the cell in tableView:cellForRowAtIndexPath: you can specify the section and row using indexPath like this:

    if(indexPath.section == 0){
    
        if(indexPath.row == 0){
    
            // setup this cell...
    
        }else if(indexPath.row == 1){
    
        }// ...
    
    }else if(indexPath.section == 1){
    
        if(indexPath.row == 0){
    
        }else if(indexPath.row == 1){
    
        }// ...
    }
    

    Do something similar in tableView:didSelectRowAtIndexPath when determining which function is called when the user taps each cell. The relevant documentation from Apple can be found here.

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

Sidebar

Related Questions

In my iPhone app I have a UIViewController that has a UITableView and another
I have a UITableView with many rows that push a DetailViewController depending on the
I am creating a section view programmatically and I have a UIButton delete also
I'm creating an app that has a UITableView. The data will be comming from
I'm creating an app that has a database using sqlite. On my app I've
I have a number of views that use UITableView. (I use UIViewController and implement
I have a grouped UITableView in my UIViewController class and I'm finding that at
I have two custom objects, Phrase Book and Phrase, the Phrase Book has an
Odd question, I am creating a UITableView, setting 8 rows of data. Simply, I'm
I have found that the first time a UITableView loads, it does not respond

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.