I am facing a problem when trying to do a Master-Detail application using Master (NSOutlineView+NSTreeController) and Detail (NSOutlineView+NSTreeController) setup.
Here is a simplest application based on Abstract-Tree example app from Apple.
https://s3.amazonaws.com/applicationtests/AbstractTree-MasterDetail.zip
I have basically a left Project Browser using a Tree Nodes, and Right Detail Browser showing the detail Tree that rely on Project Browser selection.
My setup is trivial.
Master NSOutlineView binds to Master NSTreeController handing a CoreData entity Project Node. Detail NSOutlineView binds to Detail NSTreeController handing a CoreData entity Detail Node.
Both of them are trees.
Project Node entity has a Relationship to Detail Node, allowing the Project tree show the detail tree depending on the selection.
The Problem I have is when I bind the contentObject in Detail NSTreeController to Master NSTreeController selection:
Detail NSTreeController contentObject binds to Master NSTreeController selection.detailNode
Every time I change the selection in Master tree outlineView, the detail NSTreeController creates a NSTreeControllerTreeNodes that never gets deallocated.
Basically with every Master controller selection change, the detail NSTreeContrller creates a new set of new NSTreeControllerTreeNode objects, that never gets deallocated.
Have a look at Instruments Allocation tool, every time you change selection the new nodes are created. Even after deleting all Master Nodes, the nodes are still allocated.
I have tried to prepare a NSViewController making to reload a new nib file with Master controller selection change, but this seems to me like a big overhead.
Anybody knows how to dispose the created NSTreeControllerTreeNodes when the contentObject bind changes to another value?
Thanks.