On Fri, Jul 30, 2010 at 7:37 PM, Martin Stanley
<r...@thinkingventures.com> wrote:
> Perhaps you know something about NSPredicateEditor that I don't, but I think 
> it does not use its delegate in the way you envision. To quote from the docs:

You are correct. I was thinking of NSRuleEditor.

> However, my subclass of NSPredicateEditor overrides the objectValue method 
> (to catch errors such as the one I described earlier). It would be possible 
> to parse the predicate and create back-pointers at this point. This is called 
> every time the predicate is changed. Would this be a better approach?

Yes, I would expect that whatever controller is setting and retrieving
the objectValue from the predicate editor would be doing the necessary
communication with the model to keep the view and model in a
consistent state. The best thing to do might be to use this
opportunity to convert from NSPredicate instances (for the predicate
editor's objectValue) to collections of managed objects that model the
predicate. Then Core Data delete rules and validation will take care
of all the consistency, rather than forcing this logic into the
controller or view.

--Kyle Sluder
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to