Re: -[NSManagedObjectContext save:] fails but gives no NSError
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 21:47:41 -0800
On 2007 Nov, 23, at 14:46, mmalc crawford wrote:
Under what circumstances is it not setting an error?
Unfortunately, I can't say for sure, because when it wouldn't tell me
what the error was, I took a broad look at what the hell I was doing
and realized that my code and data model were maintaining an
unnecessary entity. It looked like, prior to the -save:, I could have
been either (a) inserting or deleting the same objects twice, or (b)
inserting objects with relationships to objects that had been
deleted. (Multiple objects had relationships to the same other
objects, with Delete Rule = 'Cascade'. Oops.) But once I realized
that these other objects were not necessary, I got rid of their entity
and all that code, and things have been saving happily ever since.
What I am sure about is that, as per the code in my original post,
although I was giving -save: an NSError**, it was returning NO, my
store file on the disk was not touched, and the NSError* was nil.
If it ever happens again, I'll test more closely and let you know.
_______________________________________________
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