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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:46:55+00:00 2026-05-27T03:46:55+00:00

I have a table view as my RootViewController and push another one on a

  • 0

I have a table view as my RootViewController and push another one on a button press with this code.

[[self navigationController] pushViewController:aboutVC animated:YES];

My problem is that my button’s actions are not called when they are pressed. I have checked almost everything that I can think of and I am pretty sure that there is a view overtop of my button that is intercepting the user interaction. I have nothing else other than the button and its action coded in my new view controller. I am using a custom cell, but there is nothing in it yet.

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";

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

    tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    cell.userInteractionEnabled = NO;

    //ADD BUTTONS
    UIButton *redButton = [[UIButton alloc] init];
    redButton.backgroundColor = [UIColor colorWithRed:0.0/255 green:0.0/255 blue:0.0/255 alpha:1.00];
    [redButton addTarget:self action:@selector(redButton:) forControlEvents:UIControlEventTouchUpInside];
    redButton.frame = CGRectMake(9, 44, 40, 39);

    [cell addSubview:redButton];

    [redButton release];
    return cell;
}


- (void)redButton:(id)sender
{
    //Button action will go here
}

any ideas on what i might be doing wrong?

  • 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-27T03:46:56+00:00Added an answer on May 27, 2026 at 3:46 am
    cell.userInteractionEnabled = NO;
    [cell addSubview:redButton];
    

    Replace above lines with below 2 lines of code it will work

    cell.userInteractionEnabled = YES;
    [cell.contentView addSubview:redButton];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's my case: I have a table view showing contacts. Add button in the
I have a UITableViewController, which is RootViewController. It's XIB only has a table view.
I have a table view class called RootViewController and a class providing WiFi functionality
I have a Table View Controller with cells. I want to update the text
I have a table view controller with custom cells. In those cells i added
I have a table view that I am customizing and I am adding a
I have a table view that is managed by an NSFetchedResultsController. I am having
I have a table view controller which doesn't let me manually scroll to the
When I have a table view with some sections which have their own headers
In my iPhone application I have a table view. When user taps any 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.