Array controller bound to tree controller selection
Array controller bound to tree controller selection
- Subject: Array controller bound to tree controller selection
- From: Rick Mann <email@hidden>
- Date: Thu, 03 Apr 2014 01:48:27 -0700
I've got an NSArrayController bound to the selection of an NSTreeController. The UI is an outline table showing a hierarchy of Groups and Parts. If a Group is selected, another table shows the Parts in the Group.
The problem is that if you select a Part in the outline view, an exception is thrown because the children property of Group doesn't exist on Part, and the table view content doesn't change.
A couple of ways to solve this:
1) Only show the Group hierarchy in the outline view. Is there an easy way to do this easily? The children property of Group contains both Groups and Parts. I'd only want to show Group entities, not parts. Is there any way to filter the children by Entity type? Or will I have to change my object graph with a "subGroups" property?
2) KVO the selection and update the table view's array controller with code.
I think I prefer (1), but if you have other suggestions, please feel free to suggest them. Thanks!
--
Rick
_______________________________________________
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