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

  • Home
  • SEARCH
  • 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 8001023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:58:42+00:00 2026-06-04T15:58:42+00:00

I’m new to iOS programming, I have a project going on and along with

  • 0

I’m new to iOS programming, I have a project going on and along with it I constantly learn new features of iOS and so it came to Core Data. I’ve read through basic tutorials and explanations of it. But sadly they didn’t cover well creating a complex database. My goal is to create an application that downloads data files from server which are about 20mb XML files. And loads data from them into App’s Core Data database for user to interact with.

I’ll try to explain schema im trying to build

Each file is loaded into database as an entity of type A.
Each entity A has several properties and an array of entities B. (one to many relationship)
Each entity B has several properties and an array of entities C. (one to many relationship)

My XML structure is like

<a>
 <set of b's>
  <b1>
   <set of c's>
    <c1>
    <c2>
    ...
    <cn>
   </set of c's>
  </b1>
  <b2>
  ....
  <bn>
 </set of b's>
</a>

Since entities A simply represent different files that were imported, they are created when i create a listing of available data files on the server.
Then i plan to download file, parse it and load it’s data into database.
When i run my parser, first i get all the data needed to create entity B, then i can either create an array of dictionaries to hold data for entities C, or i can insert entities into B’s set.

The part im having troubles with is how to insert entities into MOC and how to save it. I mean should i use same MOC for all kinds of entities and save changes to it? or i should for example insert “B”s into A’s MOC, then “C”s into B’s MOC and then save at first changes in B’s MOC, then at A’s MOC?

My parser reads data in chunks, so i need some event to tell it, that i have added all data from current chunk and it’s saved and it can start reading next chunk.

I will be grateful for any help there.

  • 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-04T15:58:43+00:00Added an answer on June 4, 2026 at 3:58 pm

    Only use one MOC, pass this around and do everything with it, one save anywhere effects everything at once.

    Also you might want to look at why you are using Core Data here, Core Data is handy for actual objects, but if it’s purely data you want to store then Core Data has a lot of limitations that you might not be expecting if you are thinking of it as a SQL database.

    –

    Regarding loading your data into objects. You can just create these A,B,C objects in any order and set the properties and associations between them as you go or later on, it’s quite flexible really, just think of them as any other objective-c objects

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have some data like this: 1 2 3 4 5 9 2 6
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
I want use html5's new tag to play a wav file (currently only supported
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into

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.