Re: Core Data Questions--Relationships, UUIDs, and Dirty States
Re: Core Data Questions--Relationships, UUIDs, and Dirty States
- Subject: Re: Core Data Questions--Relationships, UUIDs, and Dirty States
- From: Jim Correia <email@hidden>
- Date: Mon, 27 Oct 2008 17:11:36 -0400
On Oct 27, 2008, at 4:31 PM, Keary Suska wrote:
1. Confirmation clarification: do I understand correctly,
considering typical RDBMS data integrity rules, that for most to-one
relationships, I would set the delete rule to "no action", since
deletion of the "many" item should not effect the "one"
What the delete action is is going to depend on the needs of your
"business" logic.
"No action" is an extraordinary choice (because without your
intervention, you'll end up with dangling inverse relationships.)
If "cascade" is not what you want, "nullify" usually is.
2. How do I best implement custom UUIDs for relationships (as a
property to an entity)? I thought I saw this come up some time ago
but I can't seem to find the discussion.
What are you trying to accomplish here? Knowing what you want to do
will help us better answer the question.
3. How can I, in a bindings-compliant manner, report the "dirty"
state of an NSManagedObjectContext? I know I can be notified when
the context has changed, and when the context has saved, but what
about when the context has been rolled back or changes undo-ed?
-hasChanges will give you the answer you are looking for, but it is
not documented as being KVO compliant.
4. Does anyone have recommendations on how I can maintain the
"dirty" state of a single NSManagedObject? I don't figure there is
anything built into CD for this.
Again, what specifically are you trying to do here?
You can ask an object if it
-isInserted
-isDeleted
-isUpdated
to query those states.
Jim
_______________________________________________
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