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

  • Home
  • SEARCH
  • 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 9211777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:22:27+00:00 2026-06-18T01:22:27+00:00

I am trying to delete with the following code. [super deleteRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationFade]; Its return

  • 0

I am trying to delete with the following code.

[super deleteRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationFade];

Its return multiple exception.

 *** Assertion failure in -[UITableView _endCellAnimationsWithContext:], /SourceCache/UIKit_Sim/UIKit-2372/UITableView.m:1070
2013-01-29 16:28:22.628 

Terminating app due to uncaught exception
‘NSInternalInconsistencyException’, reason: ‘Invalid update: invalid
number of rows in section 1. The number of rows contained in an
existing section after the update (5) must be equal to the number of
rows contained in that section before the update (5), plus or minus
the number of rows inserted or deleted from that section (0 inserted,
5 deleted) and plus or minus the number of rows moved into or out of
that section (0 moved in, 0 moved out).’

  • 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-18T01:22:28+00:00Added an answer on June 18, 2026 at 1:22 am

    It is because you should have a dynamic way of returning the number of rows.

    For example, I create an 3 arrays. Each with 3 values (these are NSArray variables) :

    In .h file:

    NSArray *firstArray;
    NSArray *secondArray;
    NSArray *thirdArray;
    

    In .m file, viewDidLoad or init or something similar:

    firstArray = [NSArray arrayWithObjects:@"Cat", @"Mouse", @"Dog", nil];
    secondArray = [NSArray arrayWithObjects:@"Plane", @"Car", @"Truck", nil];
    thirdArray = [NSArray arrayWithObjects:@"Bread", @"Peanuts", @"Ham", nil];
    

    When returning number of rows in table, I have :

    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
             return array.count;
          if (section == 0) {
              return firstArray.count;
          } else if (section == 1) {
              return secondArray.count;
          } else {
              return thirdArray.count;
          }
    }
    

    Then, in cellForRow :

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];
        if (cell == nil) {
            cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Cell"];
        }
    
        if (indexPath.section == 0) {
        cell.textLabel.text = [firstArray objectAtIndex:indexPath.row];
        } else if (indexPath.section == 1) {
            cell.textLabel.text = [secondArray objectAtIndex:indexPath.row];
        } else {
            cell.textLabel.text = [thirdArray objectAtIndex:indexPath.row];
        }
    
        return cell;
    }
    

    Then I delete @"Dog" by swiping on the table or some other way you want to delete. Then, when reloading the table, your array count will be 2, so the table will “know” that it has to display only 2 rows. Basically, you need to update your data source as well.
    It applies for the other sections as well. Because you remove elements from arrays, number of rows will be updated also.

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

Sidebar

Related Questions

I am trying to delete the data present in the dataset with following code:
I am trying to delete a file, but the following code doesn't do that.
I am trying to delete a record from a database using the following code
I'm trying to delete everything from a std::vector by using the following code vector.erase(
I'm getting the following error when trying to delete objects in my database while
I am trying to delete an entity in core data. I use the following
I am trying some way to optimize following sql statement: exe_sql DELETE FROM tblEvent_type
Consider following: $(#myform).attr({ action: @Url.Action(MVC.Thing.Delete().AddRouteValue(id, myJsModel.Id )) }); I'm trying to set the action
I am trying to delete a sub-column of a super column family. I tried
i have the following code,in which i am trying to find all data.m files

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.