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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:39:31+00:00 2026-05-26T10:39:31+00:00

I am using Core Data to store data from the server that is sent

  • 0

I am using Core Data to store data from the server that is sent in a “relational” form.

For example, the data I get from the server looks something like this (the actual format is somewhat different, but similar enough)

Users: [{PK: 1, Name: 'A B'}, {PK: 2, Name: 'C D'}, {PK: 3, Name: 'E F'}]
Posts: [{PK: 1, UserPK: 1, Content: '...'}, {PK: 2, UserPK: 3, Content: '...'}]

My Core Data model has an relationship set between Users and Posts and it works like it should. However, my problem is creating these objects and their relationships as fast as possible (without using ridiculous amounts of RAM) when I receive a new dataset from the server.

The problem is associating the posts with the users. The “normal” way to do it is to basically write post.user = user; However, this requires that I have the user loaded from the disk.

My current plan is to load all users, fault them and create a NSDictionary that maps the PK’s to the actual objects. That way I can quickly find out the user I need to associate with the post. However, this solution seems a bit complex for something that should essentially be a rather trivial operation.

  • 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-26T10:39:32+00:00Added an answer on May 26, 2026 at 10:39 am

    Your solution of keeping the users in memory in a NSDictionary is sound. They should not take very much memory at all as long as you leave them in a faulted state. A faulted MO is tiny.

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

Sidebar

Related Questions

I am fetching a set of objects from a Core Data persistent store using
I have a tableview using NSFetchedResultsController to load data from the Core Data store,
I'm using Core Data to locally persist results from a Web Services call. The
I'm using core data in my app. I have two entities that are related:
I started using core data and I read that I can save the data
Using Core Data w/a sqlite store on iPhone.... I've got a bunch of comic
We are looking to develop an application that will get data from a web
When using an SQLite persistent data store does Core Data have any kind of
I've got 2 applications using Core Data with a sqlite persistent store. I've got
I am using a custom NSValueTransformer to store color information in my Core Data

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.