• 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
NSComboBox and bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: RE: signal 10 (SIGBUS) problem
  • Next by Date: why do this not work??
  • Previous by thread: Re: signal 10 (SIGBUS) problem
  • Next by thread: why do this not work??
  • Index(es):
    • Date
    • Thread