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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:30:02+00:00 2026-05-28T07:30:02+00:00

I have an UITableView that contains 2 buttons for each UITableviewCell. How to hide

  • 0

I have an UITableView that contains 2 buttons for each UITableviewCell.
How to hide the buttons when the UITableview is in edit mode?
Thanks

  • 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-28T07:30:03+00:00Added an answer on May 28, 2026 at 7:30 am

    I suggest you to subclass UITableViewCell and add the buttons as properties, then set their hiddenproperty to YES:

    @interface CustomCell: UITableViewCell
    {
        UIButton *btn1;
        UIButton *btn2;
    }
    
    @property (nonatomic, readonly) UIButon *btn1;
    @property (nonatomic, readonly) UIButon *btn2;
    
    - (void)showButtons;
    - (void)hideButtons;
    
    @end
    
    @implementation CustomCell
    
    @synthesize btn1, btn2;
    
    - (id) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSStrig *)reuseId
    {
        if ((self = [super initWithStyle:style reuseidentifier:reuseId]))
        {
            btn1 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
            // etc. etc.
        }
        return self;
    }
    
    - (void) hideButtons
    {
        self.btn1.hidden = YES;
        self.btn2.hidden = YES;
    }
    
    - (void) showButtons
    {
        self.btn1.hidden = NO;
        self.btn2.hidden = NO;
    }
    
    @end
    

    And in your UITableViewDelegate:

    - (void)tableView:(UITableView *)tableView willBeginEditingRowAtIndexPath:(NSIndexPath *)indexPath
    {
        [(CustomCell *)[tableView cellForRowAtIndexPath:indexPath] hideButtons];
    }
    
    - (void)tableView:(UITableView *)tableView didEndEditingRowAtIndexPath:(NSIndexPath *)indexPath
    {
        [(CustomCell *)[tableView cellForRowAtIndexPath:indexPath] showButtons];
    }
    

    Hope it helps.

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

Sidebar

Related Questions

I have to create a UITableView, that contains richly formatted text within each UITableViewCell.
I have a UITableView that contains a UITextField in each cell. I can't seem
I have a grouped UITableView that contains several cells (just standard UITableViewCell s), all
I have a UITableView in a UINavigationController that contains a rightBarButtonItem which should hide
I have a problem with data in UITableView. I have UIViewController, that contains UITableView
I have a UITableView that displays single large images in each cell. The names
I have a uitableview that loads fairly large images in each cell and the
I have a UITableView that in 'normal' mode, show a UITableViewCellAccessoryDisclosureIndicator meaning if the
I have developed a simple app that contains a UITableView that displays data, and
First a little background info: I have UIViewController that contains a UITableView. In the

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.