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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:08:20+00:00 2026-05-31T22:08:20+00:00

[EDIT] I am changing this to more concisely explain what my problem was, after

  • 0

[EDIT] I am changing this to more concisely explain what my problem was, after having more precisely pinpointed the issue.

I am working on core data for my app, but am stumped. It hangs in this method every time. No crashes, no logs, no nothing. It just hangs.

- (void)insertNewObject:(id)sender
{
    NSManagedObjectContext *context = [self.fetchedResultsController managedObjectContext];
    NSEntityDescription *entity = [[self.fetchedResultsController fetchRequest] entity];
    NSManagedObject *newObject = [NSEntityDescription insertNewObjectForEntityForName:[entity name] inManagedObjectContext:context];

    Section *newSection = (Section *)newObject;
    newSection.title = @"inserted";


    NSError *error = nil;

    if (![context save:&error]) {

        NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
        abort();
    }
}

NSManagedObject *newObject = [NSEntityDescription insertNewObjectForEntityForName:[entity name] inManagedObjectContext:context];

I discovered that if I put NSLogs in these two delegate methods:

- (void)controllerWillChangeContent:(NSFetchedResultsController *)controller
- (void)controllerDidChangeContent:(NSFetchedResultsController *)controller

they just keep getting called infinite number of times.

  • 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-31T22:08:22+00:00Added an answer on May 31, 2026 at 10:08 pm

    Ok, I figured it out. I was creating an infinite loop.

    This delegate method gets called:

    - (void)controllerWillChangeContent:(NSFetchedResultsController *)controller
    

    Then this eventually gets called because I called [self.tableView beginUpdates]; in the delegate method.

    - (void)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath
    
        {
            Section *object = [self.fetchedResultsController objectAtIndexPath:indexPath];
            object.title = [NSString stringWithFormat:@"Chapter %i", indexPath.row];
            cell.textLabel.text = object.title;
    
        }
    

    Then this delegate method:

    - (void)controllerDidChangeContent:(NSFetchedResultsController *)controller
    

    The the problem is that I was actually changing the NSManagedObject’s attributes while it was updating the content

    object.title = [NSString stringWithFormat:@"Chapter %i", indexPath.row];
    

    this caused controllerWillChangeContent: to be called once again creating a loop that just goes round and round.

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

Sidebar

Related Questions

EDIT: This issue is already submitted on Github. Changing the Act part to this
EDIT: This was formerly more explicitly titled: - Best solution to stop Kontiki's KHOST.EXE
EDIT: This question is more about language engineering than C++ itself. I used C++
Okay so I'm having an issue with a current assignment (trust me this is
Edit: This question was written in 2008, which was like 3 internet ages ago.
Edit: changing .ready() call per Matt's suggestion. I use jQuery to configure some stuff
This problem has bothered me for a long time.As we know,in mathematica we can
I've got a slightly tricky problem to solve; imagine this: One of my applications
I had similar problem few days earlier but now is more complicated. I am
I have tried all of this: Changing coding system: (prefer-coding-system 'iso-latin-1-unix) Ensuring no translation:

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.