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

Re: NSComboBox and bindings


  • Subject: Re: NSComboBox and bindings
  • From: Ivan Myrvold <email@hidden>
  • Date: Wed, 26 May 2004 16:02:48 +0200

I see exactly the same problem. I didn't see any answer of this posting. Have anyone an answer to this?

Ivan

Pe 17. des. 2003 kl. 23.28 skrev David Webster:

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.


Ivan C Myrvold
OrtopediService AS
Mob. 913 16 356
Tlf. 38 14 45 93
_______________________________________________
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.


  • Follow-Ups:
    • Re: NSComboBox and bindings
      • From: Fritz Anderson <email@hidden>
    • Re: NSComboBox and bindings
      • From: mmalcolm crawford <email@hidden>
  • Prev by Date: Re: Array Key-value Paths
  • Next by Date: Re: simple telnet-like networking in cocoa
  • Previous by thread: Re: monitoring retainCount
  • Next by thread: Re: NSComboBox and bindings
  • Index(es):
    • Date
    • Thread