NSPredicateEditorRowTemplate and CoreData
NSPredicateEditorRowTemplate and CoreData
- Subject: NSPredicateEditorRowTemplate and CoreData
- From: Arved von Brasch <email@hidden>
- Date: Thu, 16 Oct 2008 21:56:48 +1100
Hello Cocoa Dev List,
I'm loving NSPredicateEditor and what it lets you do. I'm wondering
about the best way to manage what I want to do:
I want a Pop-Up Pop-Up Pop-Up template row, where the last view is
populated by every item of a particular CoreData Entity. The entity
has one attribute, 'name', that should be the display item, but the
objects themselves (or at least their URL ID) should be part of the
predicate, so that the predicate can follow the object should the name
attribute change. I'm expecting to parse the predicate tree when I
want to use it to replace the object instance with its name attribute.
That part is relatively easy to set up in a
NSPredicateEditorRowTemplate subclass. I'm using an IBOutlet link to
an NSArrayController which has all the items to populate the list
with. Overriding templateViews to populate the last view with the
appropriate values. This seems a little kludgy, but works well
enough. If there's a better solution, I'd love to hear it!
What's troubling me is the edge case where there are no objects of the
particular entity in the database. I think the best option would be
to prevent the associated Row Template from being selectable from the
left hand side Pop-Up, but I can't seem to find any way to do that.
There is a potential problem I can see with removing the item from the
left hand side Pop-Up anyway, namely, what happens if a previously
saved predicate is given to the predicate editor. Is there an elegant
solution to this?
I appreciate any ideas,
Arved von Brasch
_______________________________________________
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