CoreData & NSTreeController question
CoreData & NSTreeController question
- Subject: CoreData & NSTreeController question
- From: T Reaves <email@hidden>
- Date: Fri, 13 May 2005 15:27:42 -0400
I have an NSOutlineView connected to a NSTreeController. The
object I have bound to this is an object defined via CoreData. This
object has a collection attribute that holds the same object as
itself (i.e. an Employee object has an attribute directReports that
is a collection of other Employee's). I have the children element
defined in the NSTreeController as well. This works fine. I can add
instances, etc.
The issue I have is that because the outline is bound to a
controller of a particular type, when an instanec is added as a child
of another instance, the new object appears twice in the outline;
once as the child element of the instance added to, and once as a top
level object itself. What I want to do is limit it to only being
displayed once - at the level it was added at.
Would I use a predicate set in IB on the NSTreeController for
this? I though of children.count == 0, but: a) wonder if this will
will apply to every instance of the object, or just the top level
instances, and b) can not find documentation on how to define a
predicate in the IB inspector (children.count == 0 does not seem to
work).
Any ideas?
_______________________________________________
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