• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: -[NSManagedObjectContext save:] fails but gives no NSError
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: -[NSManagedObjectContext save:] fails but gives no NSError


  • Subject: Re: -[NSManagedObjectContext save:] fails but gives no NSError
  • From: Jerry Krinock <email@hidden>
  • Date: Fri, 23 Nov 2007 09:24:49 -0800

After I discovered and removed a bunch of stupid code, this problem went away. It appears that I was either trying to insert or delete objects twice, or trying to insert objects with relationships to objects that had been deleted (inconsistent object graph).

Lesson: Do not assume that -[NSManagedObjectContext save:] will set its argument to an NSError* whenever an error occurs. Always check its return BOOL value, because more commonly when it fails it returns NO but does ^not^ set the NSError*.
_______________________________________________


Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: -[NSManagedObjectContext save:] fails but gives no NSError
      • From: mmalc crawford <email@hidden>
References: 
 >-[NSManagedObjectContext save:] fails but gives no NSError (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: Overlapping Views
  • Next by Date: Re: Core Data to-many relationships and keyPathsForValuesAffectingValueForKey
  • Previous by thread: -[NSManagedObjectContext save:] fails but gives no NSError
  • Next by thread: Re: -[NSManagedObjectContext save:] fails but gives no NSError
  • Index(es):
    • Date
    • Thread