NSComboBox and bindings
NSComboBox and bindings
- Subject: NSComboBox and bindings
- From: David Webster <email@hidden>
- Date: Wed, 17 Dec 2003 22:28:16 +0000
Hi list,
Am I doing something wrong or is this a bug? The following is
reduced to the simplest I can make it.
I have a NSComboBox a NSArrayController and a model class with a "name"
instance variable with KVC compliant accessors. I have set the
following:
NSArrayController's - Object Class Name: to the model class
NSComboBox's bindings to:-
content ->
BindTo: NSArrayController
Controller Key: arrangedObjects
Model Key Path:
contentValues ->
BindTo: NSArrayController
Controller Key: arrangedObjects
Model Key Path: name
value->
BindTo: NSArrayController
Controller Key: selection (Note: have tried all other combinations
as well)
Model Key Path: name
I also have an Add button hooked up to the Add: action method on
NSArrayController
Repeat 3X {
Hit Add, edit the combo field followed by <cr>
}
If I drop down the list I have, for example
Item1
Item2
Item3 <- this is highlighted as it was the last item entered
If I NSLog() the contents of the NSArrayController I get the same three
strings - everything OK so far!
Now if I select Item1 from the list, for example, the text field shows
Item1 as expected but if I drop the list down again I have
Item1
Item2
Item1
if I output the contents of the NSArrayController I also have the above.
It would seem that the NSArrayController is updating the last selected
position but with the newly selected list item.
A bug or just me?
Thanks
David
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.