Re: CoreData, reset a persistent store
Re: CoreData, reset a persistent store
- Subject: Re: CoreData, reset a persistent store
- From: mmalc crawford <email@hidden>
- Date: Thu, 16 Nov 2006 02:50:49 -0800
On Nov 16, 2006, at 2:40 AM, Pierre Chatelier wrote:
Again that's the wrong way round to think about it. (...) If you
want to remove all instances of an entity, then you must ensure
that the resulting object graph is valid (there may be relationship
constraints that need to be applied)
Yes, but the NSPersistentStoreCoordinator is initialized with the
model, so the persistent store should know how to cascade deletions
by traversing relationships
Cascading deletions per se is not the issue; the issue is whether the
resulting object graph is in a valid state. This can only, in the
general case, be determined by having the objects in memory.
(Consider what happens if you allow the object graph to be saved in an
invalid state, for example if the destination of a required
relationship is not present: The next time the user loads the store
and edits a value -- perhaps completely unrelated to the "problem"
object -- then tries to save, they will be unable to do so due to a
validation error...)
mmalc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden