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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:22:54+00:00 2026-05-20T07:22:54+00:00

I am trying to add a new view with 5 buttons to a cell

  • 0

I am trying to add a new view with 5 buttons to a cell once it is selected. I am trying to do this in 3 different ways. The first one is by checking if it is selected inside the

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

method.

if (cell == nil ) {
//initial customizaton of cells
} else {
   if ([cell isSelected]) {
   //I would add the view to the cell's contentView here but it never enters this if even though the cell is still blue, I scrolled the table back and forth several times and the blue cell never evaluated here

   }
}

I have also tried to do it inside the following two methods:

- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath

And:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

I used tableView:cellForRowAtIndexPath: to get a reference to the cell and when I had that reference I tried adding the view inside the cell’s contentView but it didn’t seem to work(by “didn’t work” I mean it didn’t appear, I’ll debug this further).

I know I didn’t provide much detailed code but that’s because I mainly want to know what’s the general principle of how it should be done. I want to know why the cell doesn’t stay with the selected property equal to YES even though it stays blue (when selectionStyle is the default one) when I tap it. I want it to stay “blue”(selected) with that view inside it until I deselect it and remove said view.

  • 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-20T07:22:55+00:00Added an answer on May 20, 2026 at 7:22 am

    Did you try creating your own custom UITableViewCell? I think that is the point, you can overload setSelected: method there.

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

Sidebar

Related Questions

I am trying to add a new record to my internal table and this
I'm trying to add a variable within a new variable. My first variable is:
I am using Prism 2, trying to add four navigation buttons (First Record, Last
I'm having android surfaceView and in that I'm trying to add buttons to this.
Im new to asp.net mvc. I'm trying add new model class but it got
I'm trying to add a new nova-compute node (KUubuntu 12.04) to my single node
I am trying to add a new column into an SQLiteDatabase but every time
I'm trying to add a new JDBC Data Source connect to hive in oracle
I am trying to add a new menu item to Eclipse's popupmenus. It really
I'm trying to add a new ADO.Net Entity Data Model to an MVC project

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.