NSTableView, NSComboBoxCell and bindings
NSTableView, NSComboBoxCell and bindings
- Subject: NSTableView, NSComboBoxCell and bindings
- From: Ken Victor <email@hidden>
- Date: Thu, 12 Apr 2007 11:49:36 -0700
i'm having a problem getting the bindings right for an NSTableView
with one column having a NSComboBoxCell. the problem can be viewed
simply in interface builder as follows:
1) drag a table into an empty window.
2) drag an array controller to the nib
3) configure the array controller as follows:
object class: NSMutableDictionary
Automatically prepares content
Editable
Preserves selection
Selects inserted objects
Clears filter predicate on insertion
4) bind the value of the first column of the table to arrangedObjects.name
5) bind the value of the second column of the table to arrangedObjects.comment
6) drag a combo box cell onto the first column
7) configure the combo box cell as follows:
Editable
Enabled
Completes
8) enter the following "values" for the popup data list of the combo box:
abc
abc def
def
def ghi
ghi
9) run the nib (in IB)
10) double click first column of first row
11) type a down arrow to "open" the combo box popup and use the down
arrow key to select an item from the list.
12) type a return to select the highlighted item
13) tab to the next column
the value of the first column of the first row reverts to empty!!!
note that if you open the popup by clicking on the combo box button
it works properly. also note that typing into the combo box cell also
works properly (including completion). ie, the problem only shows up
if making a selection from the combo box popup (using keyboard or
mouse) while the text field of the combo box is selected as the first
responder.
i've tried additionally binding the value of the combo box to
arrayController.selection.name to no avail; and i've also tried only
binding the combo box value, but not the table column value.
could someone please suggest the proper way to set up this type of
bindings and/or point me to some example code.
thanx,
ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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