Re: Intercepting deletion of NSManagedObjects or how to handle deletion in non-explicit relationships?
Re: Intercepting deletion of NSManagedObjects or how to handle deletion in non-explicit relationships?
- Subject: Re: Intercepting deletion of NSManagedObjects or how to handle deletion in non-explicit relationships?
- From: Kyle Sluder <email@hidden>
- Date: Sat, 31 Jul 2010 22:18:02 -0700
On Sat, Jul 31, 2010 at 8:22 PM, Martin Stanley
<email@hidden> wrote:
> I agree that it would be nice to let Core Data handle as much of the referential integrity, etc. as possible; in fact that was why I posed the question in the first place. The problem is that one cannot "convert from NSPredicate instances (for the predicate editor's objectValue) to collections of managed objects that model the predicate" because this would alter the semantics of a SmartGroup significantly. A SmartGroup is meant to have its conditions (predicates) evaluated at runtime (and continuously, at that). But if the predicate is converted to a set of objects at predicate creation/update time this would be impossible.
Not so. You could have entities like SmartGroup, SmartGroupCondition,
SmartGroupEntity, etc. Basically you would be converting an
NSPredicate object to an NSManagedObject object.
But come to think of it, there's no way to specify a relationship to
an entity, rather than to managed objects of that entity. So that
approach is rubbish.
Some model object or controller object should listen for managed
object change notifications and invalidate predicates accordingly.
--Kyle Sluder
_______________________________________________
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