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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:07:12+00:00 2026-06-12T11:07:12+00:00

I am working on an app for some time, nearly ready for release. I

  • 0

I am working on an app for some time, nearly ready for release. I have never addressed any of the error handling in core data fetches, haven’t really ever had an error in that regard. All my fetches are populated with the standard:

 if (fetchedObjects == nil) 
 {
        // Handle Error, or Not

 }

Maybe some have an abort in there left over from the startup template. What is the best practice recommendation for handling this and similar errors throughout my project? Can I make one distinct method to put in all of these or do I have to decide on case by case basis.

  • 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-12T11:07:14+00:00Added an answer on June 12, 2026 at 11:07 am

    for a start if fetchedObjects are nil there might not have been an error. You should be checking the error directly. Read up on NSError if needed

    If (error){
        //handle error here...    
        <#statements#>
    
        //return early if this is going to cause a crash
        return;
    }
    

    Heres a list of all the possible coreData error codes:
    https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/CoreDataFramework/Miscellaneous/CoreData_Constants/Reference/reference.html

    Pare down which ones you will be using, for example if you’re not using validation you will never get validate errors.

    Then I would create a general use class that handles some of the more disasterous ones. They’re never likely to happen, but if they do your best option is to display a message to the user that something bad has happened and ask them to delete and re-install the app. (or write some reset code if thats not too difficult for your implementation).

    Then at each error point there may be some specific errors you want to handle differently. As you’ll be looking at each error point in your code anyway to remove those abort() calls this analysis will fit into your process easily.

    Usually if core data produces an error on fetch on the iPhone something disastrous has happened. If you get an error saving or inserting data then you can try to figure out why and if worst comes to worst throw away changes, after telling the user what to expect. If its unacceptable to throw away changes (e.g. if you are storing documents for the user or other user created data) the you have more work to do to figure out the problem. The most likely save error will be running out of disk space.

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

Sidebar

Related Questions

I have been working on an ASP.NET/C# web app for some time and its
I have a problem with objects allocation and release. I'm working on some app
I have been working on a searching app some time now and yesterday I
I have been working on my first app for some time now, but it
I've been working on an app for some time, and have been testing it
Hey there I have been working on a transit app for some time and
I've been working with app engine for quite some time, I know that there
I have my php app working fine, performing some other Graph API functions. However,
I have a google app engine app that has been running for some time,
I've been working on an app for some time now.. Up until now i've

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.