• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSTreeController selected object changing my model
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Beginner asking: Tokens in NSTextView
  • Next by Date: Re: Miss #include <vector>
  • Previous by thread: Re: Miss #include <vector>
  • Next by thread: NSView Updates from Drawer Buttons
  • Index(es):
    • Date
    • Thread