programmatically adding model objects to NSOultineView/NSTreeController
programmatically adding model objects to NSOultineView/NSTreeController
- Subject: programmatically adding model objects to NSOultineView/NSTreeController
- From: Ken Victor <email@hidden>
- Date: Fri, 8 Jun 2007 18:18:29 -0700
i've got an NSOutlineView bound to an NSTreeController. if i
programmatically add a new child object to one of the nodes, it works
fine and displays only if the parent of the new child already had
other children. however, if i add a child to a node that didn't
previosly have any children, it is not showing up.
i suspect my problem is either lack of or misuse of KVO/KVC or the
fact that my model objects are actually instances of NSProxy or
possibly because my childrenKeyPath method returns a set (instead of
an array).
this is possibly further "complicated" in that the set returned by my
childrenKeyPath is not an iVar in my model objects, but instead is
created as necessary when my childrenKeyPath method is called, thus i
don't believe any KVO notifications for the childrenKeyPath get sent
when i actually create the new model object. i tired to manually send
will/did change for the
childrenKeyPath when creating the model object, but i can't do this
because NSProxy doesn't have will/did change ... methods.
does my analysis make sense, specifically, is it likely this is
failing for me because of the lack of KVO notification for the
NSProxy model objects? and if so, how can i implement the needed
will/did change methods for an NSProxy object? or is my problem more
likely caused by my childrenKeyPath returning a set rather than an
array?
i've been working on this for 2 days now with no success, and i've
tried searching the archives and google.
i realize this all may be a little vague and is lacking any specific
code, but i'm more looking for suggestions/pointers/or pointers to
documentation.
thanx,
ken
_______________________________________________
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