Having trouble with NSTreeController, Core Data, and NSOutlineView
Having trouble with NSTreeController, Core Data, and NSOutlineView
- Subject: Having trouble with NSTreeController, Core Data, and NSOutlineView
- From: Sam Stigler <email@hidden>
- Date: Thu, 3 May 2007 08:35:23 -0700
Hi,
I've been struggling with this for a while, so I figured I'd post this question
to the list and see if anybody has any ideas: I'm attempting to make my first
program that uses Core Data, NSOutlineView, and NSTreeController all together.
I used a really great tutorial I found at
http://www.bleepsoft.com/tyler/index.php?itemid=9 to get up to the point where
I now have my first level of outline objects (the upper level in the hierarchy)
in the outline view, but when I created a test lower-level object (one level
down), it is just showing up as a blank line because I cannot figure out a way
to tell the bindings that I want the children to not just be a relationship
(e.g., "children"), but an attribute in that related entity (e.g.,
"children.fileName"). Every time I try, it gives me the following error:
[<_NSFaultingMutableSet 0x37e3a0> addObserver:forKeyPath:options:context:] is
not supported. Key path: fileName
My entities are (with some attributes left out for time's sake):
Entity: OutlineGrouping
Attribute: name (String; neither optional nor transient)
To-Many Relationship:
Name: children
Optional and transient
Destination: Media
Inverse: grouping
Delete Rule: Nullify
Entity: Media
Attribute: author (String; optional)
...
Attribute: fileName (String; not optional, not transient)
...
To-One Relationship:
Name: grouping
Neither optional nor transient
Destination: OutlineGrouping
Inverse: children
Delete Rule: Nullify
I have already tried overriding
(void)outlineView:willDisplayCell:forTableColumn:item in my outline view with
the idea that I could simply intercept the Media NSManagedObject and return its
fileName attribute instead, but the method was never called, I guess because I'm
using bindings instead of a data source.
Any ideas you have would be greatly appreciated.
Thanks,
Sam
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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