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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:16:36+00:00 2026-06-03T04:16:36+00:00

My app is downloading JSON objects in when the app enters background mode. The

  • 0

My app is downloading JSON objects in when the app enters background mode. The app converts them to core data entities. The issue that I’m running in is that I need to merge the managed object contexts for these core data entities with the main managed object context.

The way to merge these changes is through notifications:

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


- (void)contextHasChanged:(NSNotification*)notification
{

    NSLog(@"received notification with object: %@",[[notification object] description]);
    if ([notification object] == [AppUser managedObjectContext]) return;

    if (![NSThread isMainThread]) {
        [self performSelectorOnMainThread:@selector(contextHasChanged:) withObject:notification waitUntilDone:YES];
        return;
    }

    [[AppUser managedObjectContext] mergeChangesFromContextDidSaveNotification:notification];
}

For some reason my code does not receive these notifications while running in background. Does the app continue to generate notifications while it is running in background mode? Or is it something with the location of where/when I register for such notifications that’s wrong?

Thank you for the clarification!

  • 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-03T04:16:37+00:00Added an answer on June 3, 2026 at 4:16 am

    app continues to send notifications either in main or background. you need to take care of
    the observer should not be released during add observer and posting notification. i thnk there may some mistak in implementaion read this

    https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/CoreDataFramework/Classes/NSManagedObjectContext_Class/NSManagedObjectContext.html

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

Sidebar

Related Questions

Im currently writing an iphone app that requires the downloading of data that needs
I am downloading and parsing JSON objects to build a news feed to populate
So I have an app that downloads and parses a JSON feed with some
I am downloading a JSON feed asynchronously in my App Delegate class. Now the
I'm trying to reload my app with new data from a JSON feed. i'd
I am doing optimization of web app, where I get list data in JSON
I have an app that is downloading a zip file and then copying this
I'm writing an android app that will connect to a REST/JSON webservice. Users will
I'm building an app that requires downloading a lot of html5 content. Essentially it
The Situation: Somewhere in my app I start downloading data from my server. Before

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.