Skip navigation.
 
mlCore Data Undo problem with validateForUpdate (CoreData could not fulfill a fault)
FROM : Brad Willoughby
DATE : Thu Jul 20 03:24:49 2006

I'm having a problem with Core Data which produces the error:
"CoreData could not fulfill a fault" and I'm hoping someone can help.
I have scoured the archives and google and have found that specific
error but none of the causes seem to be related to what I'm seeing.

I have posted a stripped-down sample application here:
http://members.cox.net/bradwilloughby/UndoTester.dmg

Basically, I have two entities: Item and Collection.  In Collection, I
have implemented validateForUpdate: to validate the sequence of Items
whenever an item is added or deleted.  I can produce a failure by
doing the following:

1. Create a collection called "Collection"
2. Add two items with sequence 0 and 1, set their collection to
"Collection", and save.  This works fine.
3. Delete item 1 and save.  This works fine since the only remaining
item has a sequence of 0.
4. Undo to restore item 1 and save.  This works fine since there are
now items 0 and 1.
5. Delete item 0 and attempt to save.  This will produce a validation
error since the sequence doesn't start with 0.
6. Undo to restore item 0 and attempt to save.  This will produce
"CoreData could not fulfill a fault"

It appears that anytime my validateForUpdate returns NO it breaks undo.

Any ideas out there?  Thanks in advance.
Cheers,
Brad

Related mailsAuthorDate
No related mails found.