• 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
Re: binding to number of selected rows in a table
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: binding to number of selected rows in a table


  • Subject: Re: binding to number of selected rows in a table
  • From: Jerry Krinock <email@hidden>
  • Date: Tue, 3 Mar 2009 22:02:38 -0800


On 2009 Mar 03, at 18:38, James Walker wrote:

Are these NSOutlineView methods not KVO-friendly, or am I doing something wrong?

I would say the answer to your question is "both" :))

And I also believe that you have two options:

1. Assuming you're using the "classic" dataSource to drive your outline view, you can do what I've done...

* Add your controller as an observer of NSOutlineViewSelectionDidChangeNotification
* Subclass NSOutlineView
* Add a dummy instance variable (I use a BOOL) to your NSOutlineView
* When NSOutlineViewSelectionDidChangeNotification is observed, change your
instance variable (I toggle my BOOL)
* Implement (if Leopard-only) +keyPathsForValuesAffecting<Key>, or if Tiger,
use -setKeys:triggerChangeNotificationsForDependentKey:, so that changes in
your dummy variable will affect/trigger the changes you want.


2. Use NSTreeController. I'm not sure about this because I've never used NSTreeController, but I assume that it provides the observable key paths like you want. I think that providing these observable key paths is one of the purposes of NSArrayController, and I assume that NSTreeController is to NSOutlineView as NSArrayController is to NSTableView. Someone will correct me if I'm wrong...


_______________________________________________

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


  • Follow-Ups:
    • Re: binding to number of selected rows in a table [solved]
      • From: James Walker <email@hidden>
References: 
 >binding to number of selected rows in a table (From: James Walker <email@hidden>)

  • Prev by Date: Re: Getting NSDate from EXIF of a image
  • Next by Date: CoreData and NSUndoManager/Undo Grouping...
  • Previous by thread: binding to number of selected rows in a table
  • Next by thread: Re: binding to number of selected rows in a table [solved]
  • Index(es):
    • Date
    • Thread