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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:06:00+00:00 2026-05-28T05:06:00+00:00

When loading data into Core Data, my child objects aren’t getting the parent ID

  • 0

When loading data into Core Data, my child objects aren’t getting the parent ID set. This is all generated as I walk through an xml document using TBXML. (code heavily paraphrased for brevity)

a = NSEntityDescription insertNewObjectForEntityForName:@"A"
set various a attributes
if a.Type isEqualToString:@"TypeA"
    b_set = NSMutableSet new
    for each child element of a
        b = NSEntityDescription insertNewObjectForEntityForName:@"B"
        set various b attributes
        b.a = a
        b_set addObject:b
    next
    a.bs = b_set
end
blah blah blah

When all is said and done, all the a’s and b’s, and all their atttributes are correctly persisted to SQLite, except that all the b’s have null for their a (the parent) attribute.

Do I have to rework this to write the a before creating the b’s so they have a real objectID to reference?

  • 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-28T05:06:01+00:00Added an answer on May 28, 2026 at 5:06 am

    Reverse relationships are updated as part of -processPendingChanges. That will get called as part of -save:. If you need to, you can call it directly. CoreData will not update the reverse relationships immediately since it’s costly.

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

Sidebar

Related Questions

I have an ipad app that is loading data remotely into core data, I
I'm working with Core Data and having a lot of trouble's getting data into
Sup guys. I'm loading data into a table using ajax and jquery. This can
I'm loading XML data into an object with this LINQ statement: var smartFormFields =
I'm loading data into a DataSet from an XML file using the ReadXml method.
Summary of the issue: When I am loading some data into my iPhone application
Currently I am loading data from a previous session into my application using the
I'm loading data from a MySQL database into a C# .NET application. The data
I'm looking for a solution for producing SPSS format data files for loading into
I am using a ProgressDialog for Loading data..... Can I set it up for

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.