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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:49:09+00:00 2026-06-08T20:49:09+00:00

I have an app that tracks a users driving trips (Paths). I save all

  • 0

I have an app that tracks a users driving trips (Paths). I save all the information using Core Data.

The db structure:

Path ->> Point

Point contains lat and long values.

What I do is, each time CLLocationManager is updated I add that point to an array. Once the user has reached the end of the path, I loop through and add all those locations to the db.

My question is…is this the best way to go about this? My two options are:

  1. Add all locations to array, then add all locations to core data.

  2. Each time CLLocationManager is updated, add that directly to core data.

I’m not sure if there is some best practice to accessing/altering core data. Should I do it in bulk (for loop), so that I can call

if ([managedObjectContext save:&error]) {
   // handle save error
}

at the end of the for loop and keep it all condensed.

Or should I simply add a new Point each time CLLocationManager updates calling [managedObjectContext save:&error] after each update.

The only concern I have with Option1 is that if the app crashes while recording a path, none of the information will be saved.

So a benefit of using Option2 is that the data will be saved after each update but I’m not sure if accessing core data this frequent is bad practice.

Thank you very much for taking the time to help.

  • 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-08T20:49:11+00:00Added an answer on June 8, 2026 at 8:49 pm

    With the assumed frequency of NSLocationManager updates (max every few seconds) it is absolutely fine to save frequently. Also, your array will eat up more and more memory which is not really necessary.

    You could still do it in discreet quantities, say, one save every 10 points.

    Also you should perhaps save in applicationWillResignActive in case the app is interrupted.

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

Sidebar

Related Questions

I have an app that tracks wildlife where the user enters data based on
I have an app that potentially tracks a large amount of data during app
I have a web app that will draw a polyline for each user (tracks
I have an app that received JSON data from the server. Currently when I
I am working on an app that tracks a users location. After about 20
I have a data entry web app where the control that has focus is
I have an iPhone (iOS) app that keeps data in a local SQLite database
I have built a ruby on rails app that lets users track their workouts.
I have built a ruby on rails app that lets users track their workouts.
I have built a ruby on rails app that lets users track their workouts.

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.