Core Data - "Items cannot be deleted from X"
Core Data - "Items cannot be deleted from X"
- Subject: Core Data - "Items cannot be deleted from X"
- From: Nick Zitzmann <email@hidden>
- Date: Wed, 20 Aug 2008 21:21:23 -0600
I tried searching via the usual engines and found nothing.
I have two Core Data entities. Entity X has a to-many relationship
with entity Y. On entity X, the relationship may refer to zero or many
instances of entity Y, and deleting an instance of entity X is
supposed to cascade-delete instances of entity Y. On entity Y, the
inverse-relationship back to X is mandatory, and deleting an instance
of entity Y is supposed to nullify the relationship to entity X.
But when I try to delete a saved record belonging to entity Y, the -
validateForDelete: method always says NO, and returns error 1600,
"Items cannot be deleted from (name of inverse-relationship pointing
to X)." Why doesn't this work? It should be delete-able because Core
Data is supposed to nullify the relationship to the entity X record,
which is not being deleted, and furthermore instances of entity X do
not need to have any relationships with instances of entity Y.
I already tried calling -processPendingChanges prior to validation,
and that made no difference. What's going on here?
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
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