Re: Detecting changes to NSPopUpButtonCell in an NSTableView
Re: Detecting changes to NSPopUpButtonCell in an NSTableView
- Subject: Re: Detecting changes to NSPopUpButtonCell in an NSTableView
- From: Jerry Krinock <email@hidden>
- Date: Fri, 24 Apr 2009 05:25:56 -0700
On 2009 Apr 23, at 16:39, Ulai Beekam wrote:
Furthermore, it doesn't seem to make too much sense to bind the
selected index to a single variable because, as you say, I have
multiple rows and the popupmenu for each one.
Actually I can think of one weird way of making it work: Having an
instance variable "int selectedIndex" with ONLY a setter method (NOT
a getter method). That way change in one of the rows will not
propagate to other rows. And I can then do my stuff in the setter
method. But hmm, this is just too weird to be the best solution
available out there, assuming it even works :S
Indeed, this is too weird. The normal way to use bindings with a
table is to bind through an array controller to the key path
arrangedObjects.foo. Almost any Apple Sample Project containing a
table will do this.
However, this is only relevant if you want to convert your table to
use bindings.
Getting back to your original question, without using bindings, I'd
say that you detect changes in the implementation of the action method
which you have assigned to the NSPopUpButtonCell's menu.
_______________________________________________
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