NSTreeController selected object changing my model
NSTreeController selected object changing my model
- Subject: NSTreeController selected object changing my model
- From: Scott Ellsworth <email@hidden>
- Date: Tue, 21 Mar 2006 13:54:30 -0800
I have a CD model whose entity instances are displayed in an
NSOutlineView and associated NSTreeController. This works - the
right entities are showing up, I can mouse around, and all is well.
Now I want my MainWindowDocumentController to be notified when the
user clicks on a row, selecting something. I can then change my main
view depending on what the user clicked on. The
MainWindowDocumentController is exposed via an ObjectController on
File's Owner in the same nib as the NSTreeController.
One obvious way: create an outlet in MainWindowDocumentController for
the NSTreeController, then set up KVO on the -(NSArray *)
selectedObjects property of the NSTreeController in awakeFromNib, and
disconnect it in dealloc.
Is there a better way? All of the ways that involved binding in IB
seemed convoluted.
Scott
_______________________________________________
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