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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:35:07+00:00 2026-06-05T16:35:07+00:00

I’m still new to Core Data, so forgive the question. I’m building an app

  • 0

I’m still new to Core Data, so forgive the question.

I’m building an app that (to make it simple) allows people to “challenge” themselves and others. I need to store locally the challenges the user has already accepted, so that he can browse their details offline. However, when the app is online I’m making requests to the server to display the available challenges, the new details of the already accepted challenges, etc. So some syncing will be needed, but I`m trying to keep that to the minimum.

Now my problem is how to architecture the data. Should I:

(1) Have a core data model only for the data that is stores on the device; then just build model classes for the challenges that are being parsed from the server, and display an array of Challenge objects in my table views?

(2) Have a single core data model for both, but somehow distinguish between the Challenges that are local to the ones that are transient?

(3) Have two persistent stores, one for each purpose?

Options 2 and 3 obviously have the advantage of using NSFetchedResultsController, but may be more complex to code and maintain.

And, as to the syncing problem, should I:

(4) Keep a timestamp of the last time each of my local Challenges were updated, and match these with the timestamps on the server, to see if I need to push new details to the server or not?

(5) Save an array of keypaths and the changes, and then push that to the server once internet connection is available again.

What would be the best approach to solve these two problems.

Thanks a lot!

  • 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-05T16:35:08+00:00Added an answer on June 5, 2026 at 4:35 pm

    Since this is a design question and design is an art in a sense that there are always more than one approach, here is what I would probably do.

    I would create a model to store both local and available challenges distinguishing them by some property. When there is no network connectivity, I possibly could choose to filter out all remote challenges not to show cached (or transient as you put it) challenges. When the connectivity is resumed or when sync takes place, I would check if I need to update any of the challenges either on the server or locally.

    Timestamps is a good way to check for modification time of the entity. If you need to do property by property comparisons for conflict resolution, you could use checksums such as crc32 or md5 hash to speed up comparison of binary data should you have any.

    Even with timestamps it is possible that an object was touched, but the values saved remained actually the same, so checksum could be used to detect if actual changes were made to the object. You can use NSKeyedArchiver to serialize an object into an NSData and calculate a checksum on it. I have found this approach reliable.

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

Sidebar

Related Questions

I am doing a simple coin flipping experiment for class that involves flipping a
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
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.