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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:15:25+00:00 2026-06-12T09:15:25+00:00

I use NSFetchedResultsControllerDelegate to display my cells after all my datas are downloaded and

  • 0

I use NSFetchedResultsControllerDelegate to display my cells after all my datas are downloaded and inserted into coreData.
I use the code below to know when a modification occurred

[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshDatas:) name:NSManagedObjectContextDidSaveNotification object:nil];

then, this method is called

- (void)refreshDatas:(NSNotification *)notification
{
    [[self.fetchedResultsController managedObjectContext] mergeChangesFromContextDidSaveNotification:notification];
}

But, i have a problem, there is 5 to 10 seconds between the first call of insertRowAtIndexPath of the delegate NSFetchedResultsControllerDelegate and the display of the cell inserted in the UITableView and i don’t know why.

Thanks for your help

  • 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-12T09:15:26+00:00Added an answer on June 12, 2026 at 9:15 am

    If you are using a background thread and the notification is fired there, you need to “republish” the notification in the main thread like:

    - (void)refreshDatas:(NSNotification*)notification
    {
      if ([notification object] == [self managedObjectContext]) return;
    
      if (![NSThread isMainThread]) {
          [self performSelectorOnMainThread:@selector(refreshDatas:) withObject:notification waitUntilDone:YES];
          return;
      }
    
      [[self managedObjectContext] mergeChangesFromContextDidSaveNotification:notification];
    }
    

    If this it is not the problem, try to add some details to your question. Core Data is difficult and without details it’s difficult to understand what is going on.

    Edit

    You don’t merge changes if the [notification object] (a context in this case) is the main one. On the contrary, if that context is coming from a different thread, you merge changes. This is for performance reasons but you could simply remove it.

    Hope that helps.

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

Sidebar

Related Questions

Use case example: Client A comes to request sales information, enters their zip code
Use case: I find a piece of code that I do not understand at
Use a hidden field will fix my issue... i got it.. Hi All, I
use case is simple: I want to run some boiler plate code before each
use a reapeter to display data, but sometimes the data is to big to
I have NSFetchedResultsController that I need to show data at tableView I use NSFetchedResultsControllerDelegate
USE AdventureWorks2008R2; GO INSERT INTO myTestSkipField SELECT * FROM OPENROWSET(BULK 'C:\myTestSkipField-c.dat', FORMATFILE='C:\myTestSkipField.fmt' ) AS
use I can't divide into segads. As for my above example if 5 threads
Use Case Show a photo uploaded by the user in a square box with
use C#,want to upload excel file on google doc. bellow syntax use to upload

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.