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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:21:33+00:00 2026-05-24T16:21:33+00:00

I have an app with some stocks information for example and store it in

  • 0

I have an app with some stocks information for example and store it in CoreData. I have two entities Stock(name) and DailyStockData(date,number) and I store two years information for each stock entity. Then user can delete some Stock names in TableView.

In my - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
I delete this Stock and DailyStockData cascade and save context then.

My save code looks like this

// Save the context.
NSError *error = nil;
if (![context save:&error])
{
    NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
    abort();
}

The problem is: when User deleting stocks fast – my app crashing. I understand that the reason is “abort” command when my device didn’t finish save previous deleting transaction and call to save it again.

So I have two questions here ^)
1. Is there any way to prevent this crash?
2. What is best practice to deal with context save error? May be I can try save it again and again rather than just abort.

The simplest solution is redesign application to save context at the “very” end – for example when my app change view or something but I want to know all possibilities.

  • 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-24T16:21:35+00:00Added an answer on May 24, 2026 at 4:21 pm

    You should NOT invoke “save” frequently, it’s bad for performance.

    The “save” method let the CoreData actually save the modified data to your disk, it takes time if there are a lot of data need to be saved.

    Just save once while your App is going to exit or going background is good enough.

    If you worry about an unexpected crash will lose some data, you can invoke “save” when your users stop modifying data for a while or exited the edit view in your App. It depend on your decision, but just don’t save every time your data is changed.

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

Sidebar

Related Questions

I have a SEAM app with some JPA/Hibernate entities. And I now wonder where
I have a Rails app with some basic models. The website displays data retrieved
Problem: We have a web app that calls some web services asynchronously (from the
need ask you about some help. I have web app running in Net 2.0.
I have a standalone Java app that has some licensing code that I want
I have a Rails app that will post some data to another Rails app.
I have one console app that is doing some lengthy syncing to an ftp
I have a Pylons app where I would like to move some of the
.NET 3.5, C# I have a web app with a search feature. Some of
I have some code like this in a winforms app I was writing to

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.