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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:34:56+00:00 2026-06-05T20:34:56+00:00

On my view, I used to have few buttons and each button had an

  • 0

On my view, I used to have few buttons and each button had an action associated with it.

    UIButton *testButton = [[UIButton alloc] initWithFrame:CGRectMake(120,300,90,90)];
    [testButton setBackgroundImage:[UIImage imageNamed:@"test.jpg"] forState:UIControlStateNormal];
    [testButton addTarget:self.view action:@selector(gotoProd:) forControlEvents:UIControlEventTouchUpInside];
    [testButton addt
    [scrollView testButton];

But now I am trying to replace all those buttons with the tableview with rows. I was able to populate the rows and I know one needs to use didSelectRowAtIndexPath for handling on select event of the cell. But how can I implement action:@selector(gotoProd:) in tableviews ?? Any help 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-05T20:34:57+00:00Added an answer on June 5, 2026 at 8:34 pm

    The most straight-forward way would look like this:

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
          switch (indexPath.row) {
            case 0:
                [self doRow0Action];
                break;
            case 1:
                [self doRow1Action];
                break;
            // etc...
    
            default:
                break;
        }
    }
    

    If you wanted to instead, you could initialize an array with SEL types:

    [actionArray addObject:@selector(doRowNAction)];
    

    then access it like this:

    [self performSelector:[actionArray objectAtIndex:indexPath.row] withObject:nil];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a mvc view made up of a matrix of radio buttons. Each
I have used a pattern of compound view models for a few of the
I have used this custom grid view in my code, and I want to
I have used a list view that uses a grid view in WPF. I
I read somewhere the view ids used by JSF framework have a happy side
I have a view that is used in a UINavigationController and and is automatically
I have a ios program for iPad. It is used 2 view, A view
I have AutoCompleteTextView attached to my view, and used ArrayAdapter to populate for list
I have a subview over my UITable that is used as a busy view.
In my application I have few views with longer text. In my detail view

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.