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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:49:49+00:00 2026-05-28T16:49:49+00:00

I’ve been struggling with this problem for a good 2 hours now and I

  • 0

I’ve been struggling with this problem for a good 2 hours now and I can not get it to work.

I have a view controller with a table view on it with a list of items. When the user touches the EDIT button in the navigation bar the table view should enter “edit mode” and under the list of items one new cell should appear that should only be visible when it is in “edit mode”.

So in my -tableView:cellForRowAtIndexPath: method I’m checking if (tableView.isEditing) to setup the cell. I’ve tried overriding -setEditing:animated: and doing [tableView reloadData] calls but I just can’t get it to work.

This is what my -setEditing:animated: look like:

- (void)setEditing:(BOOL)editing animated:(BOOL)animated {
    [super setEditing:editing animated:animated];
    [self.groupDetailsTableView setEditing:editing animated:animated];
}

My -tableView:cellForRowAtIndexPath:

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


    NSUInteger row = [indexPath row];


    if (tableView.isEditing) {

            // Other tableview code has been omitted

            UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault 
                                                           reuseIdentifier:nil];

            // Set the background view of the cell to be transparent        
            UIView *backView = [[UIView alloc] initWithFrame:CGRectZero];
            backView.backgroundColor = [UIColor clearColor];
            cell.backgroundView = backView;

            UIButton *deleteButton = [UIButton buttonWithType:UIButtonTypeCustom];
            [deleteButton setFrame:[cell.contentView frame]];
            [deleteButton setFrame:CGRectMake(0, 0, cell.bounds.size.width-20, 44)];
            [deleteButton setBackgroundImage:[UIImage imageNamed:@"redbutton.png"] forState:UIControlStateNormal];
            [deleteButton setTitle:@"Delete Group" forState:UIControlStateNormal];
            [deleteButton.titleLabel setFont:[UIFont boldSystemFontOfSize:20]];
            [deleteButton.titleLabel setShadowColor:[UIColor lightGrayColor]];
            [deleteButton.titleLabel setShadowOffset:CGSizeMake(0, -1)];
            [deleteButton addTarget:self action:@selector(deleteGroup) forControlEvents:UIControlEventTouchUpInside];

            [cell.contentView addSubview:deleteButton];

            return cell;

        }
}

And I’m calling [self setEditing:YES animated:YES]; from a method when the user touches the Edit button. I’ve also tried just calling [super setEditing:YES animated:YES]; and [self.groupDetailsTableView setEditing:YES animated:YES];

  • 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-28T16:49:50+00:00Added an answer on May 28, 2026 at 4:49 pm

    Found the answer myself at http://developer.apple.com/library/ios/#documentation/UserExperience/Conceptual/TableView_iPhone/ManageInsertDeleteRow/ManageInsertDeleteRow.html#//apple_ref/doc/uid/TP40007451-CH10-SW19

    Apparently -tableView:cellForRowAtIndexPath: doesn’t get called automatically when calling -setEditing:animated:

    So to have a new cell “appear” I set the alpha to 0.0 and then 1.0 after calling setEditing…

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have this code to decode numeric html entities to the UTF8 equivalent character.
Does anyone know how can I replace this 2 symbol below from the string
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i

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.