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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:21:39+00:00 2026-05-26T09:21:39+00:00

CoreData: error: Serious application error. An exception was caught from the delegate of NSFetchedResultsController

  • 0
CoreData: error: Serious application error.  An exception was caught from the delegate of 

NSFetchedResultsController during a call to -controllerDidChangeContent:.  Invalid update: invalid number of sections.  
The number of sections contained in the table view after the update (1) must be equal to the number of sections contained in the table view before the update (0), plus or minus the number of sections inserted or deleted (0 inserted, 0 deleted). with userInfo (null)

the error like that? how can I know? what’s wrong with my code.. I don’t understand with that error.. anyone can tell me what is that? and how can I fix that hell?

number of section is always 1.. Why it start of 0 before the update? How do I make the table recoqnize that there is 1 and only 1 section before any updating?

    -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
    {
        return [[self.FetchController sections] count];
    }

    -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
    {
        id <NSFetchedResultsSectionInfo> sectionInfo = [[self.FetchController sections] objectAtIndex:section];
        /*int numberOfRow=[sectionInfo numberOfObjects]-(self.numberOf20SkipFromtheBeginning*20);
        numberOfRow = MIN(20,numberOfRow);*/
        //int numberOfRow=MIN(100,[sectionInfo numberOfObjects]);
        CalledRowCountingNotYetCallRowForSection=true;
        [self.tableViewA setBounces:YES];

        if([sectionInfo numberOfObjects]>100){
            //[Timer searchCriteriaChanged];
            CLog(@"Something Wrong This NumberOfRow: %d", [sectionInfo numberOfObjects]);
        }


        return [sectionInfo numberOfObjects];
    }

    -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        DLog(@"Function TableView AT listnewController");

        CalledRowCountingNotYetCallRowForSection =false;
        if ([self tableView:tableView numberOfRowsInSection:indexPath.section]==0)
        {
            DLog(@"Something is VERY WRONG. Number of Section: %d" ,indexPath.section);
        }
        DLog(@"Indexpath at cellForRowAtIndexPath : %d", indexPath);
        Business * theBiz=[self.FetchController objectAtIndexPath:indexPath];
        return theBiz.CustomCell;

    }

    -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
        DLog(@"Function didselectrowatindexpath listnewcontroller");
        //[BNUtilitiesQuick UtilitiesQuick].currentBusiness=[[self.FetchController fetchedObjects] objectAtIndex:[indexPath row]+self.numberOf20SkipFromtheBeginning*20];
        [BNUtilitiesQuick UtilitiesQuick].currentBusiness=[[self.FetchController fetchedObjects] objectAtIndex:[indexPath row]];
        [BNUtilitiesQuick SafelyPushControllerAtNavigationController:[BNUtilitiesQuick NearbyIsiKota].mDetailBusiness atNavigationController:[BNUtilitiesQuick NearbyIsiKota].navigationController];
    }

    - (void)controllerWillChangeContent:(NSFetchedResultsController *)controller {
    DLog(@"controllerWillChangeContent: %@", controller);
    [self.tableViewA beginUpdates];

}


- (void)controller:(NSFetchedResultsController *)controller didChangeSection:(id <NSFetchedResultsSectionInfo>)sectionInfo
           atIndex:(NSUInteger)sectionIndex forChangeType:(NSFetchedResultsChangeType)type {

    DLog(@"didChangeSection: %@", controller);

    switch(type) {
        case NSFetchedResultsChangeInsert:
            [self.tableViewA insertSections:[NSIndexSet indexSetWithIndex:sectionIndex] withRowAnimation:UITableViewRowAnimationFade];
            break;

        case NSFetchedResultsChangeDelete:
            [self.tableViewA deleteSections:[NSIndexSet indexSetWithIndex:sectionIndex] withRowAnimation:UITableViewRowAnimationFade];
            break;
    }
}


- (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject
       atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type
      newIndexPath:(NSIndexPath *)newIndexPath {

    DLog(@"controller:%@\ndidChangeObject:%@\natIndexPath:%@\nforChangeType:%d\nnewIndexPath:%@\n",controller, anObject, indexPath, type, newIndexPath);

    UITableView *tableView = self.tableViewA;
    DLog(@"%@", self.tableViewA);
    switch(type) {
        case NSFetchedResultsChangeInsert:
                [tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:newIndexPath] withRowAnimation:UITableViewRowAnimationRight];
            break;

        case NSFetchedResultsChangeDelete:
            [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationRight];
            break;

        case NSFetchedResultsChangeUpdate:

            //[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationLeft];
            //[tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]withRowAnimation:UITableViewRowAnimationRight];
            //[tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationNone];
            break;

        case NSFetchedResultsChangeMove:
            [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationRight];
            [tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:newIndexPath]withRowAnimation:UITableViewRowAnimationRight];
            break;
    }

}


- (void)controllerDidChangeContent:(NSFetchedResultsController *)controller {
    [self.tableViewA endUpdates];
}
  • 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-26T09:21:40+00:00Added an answer on May 26, 2026 at 9:21 am

    This is most likely caused by providing a sectionNameKeyPath for the NSFetchedResultsController when it doesn’t need one.

    If you provide a sectionNameKeyPath but there are no values yet for that key path, the fetched results controller will report that the table has zero sections. If that key path acquires a value, the fetched result controller will report that the table now has one or more sections.

    To fix, make sure that sectionNameKeyPath is empty when you initialize the fetched results controller. You can also hardwire numberOfSectionsInTableView: to always return zero or one.

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

Sidebar

Related Questions

Here is the exception: Serious application error. Exception was caught during Core Data change
2011-12-28 10:52:13.633 BadgerNew[663:707] CoreData: error: (NSFetchedResultsController) object <Business: 0x628c8e0> (entity: Business; id: 0x628c870 <x-coredata://8D661026-BBFA-4C41-B434-167800D925DD/Business/p88>
I have an app using tableview and NSFetchedResultsController. I am getting the error: Serious
I get the following error when trying to add a record: Serious application error.
I get an annoyingly vague error from the following code: GFree2AppDelegate *delegate = [[UIApplication
I am receiving a CoreData could not fulfill a fault for ... error message
I created a CoreData application using the Cocoa Touch Template. I modified the included
I have an application that uses CoreData. I previously had a class named Marker
I am trying to add value to CoreData from .plist and get from coreData
Afetr inserting a new record into my CoreData store using an NSFetchedResultsController, when 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.