Binding NSPopUpButton with Option "Inserts Null Placeholder"
Binding NSPopUpButton with Option "Inserts Null Placeholder"
- Subject: Binding NSPopUpButton with Option "Inserts Null Placeholder"
- From: email@hidden
- Date: Sun, 28 May 2006 16:25:47 +0200
Hello,
I hope somebody could help me, spent already days for solving the following
problem with a NSPopUpButton and Bindings:
I have an NSPopUpButton and an NSArrayController bound to it. The
NSArrayController gets the data from CoreData. Because I need a 'no region'
menu item in the NSPopUpButton, I selected the option "Inserts Null
Placeholder" for the binding.
All works fine, except for the "no region" menu item, which throws an exception
"[<NSArrayController 0x1116450> setNilValueForKey]: could not set nil as the
value for the key selectionIndex." when selecting it.
What's wrong?
Here's how I set up the binding for the ArrayController:
I have a NSPopUpButton with the follwing Bindings:
content:
Bind To: regionController (NSArrayController)
Controller Key: arrangedObjects
x Inserts Null Placeholder (because I need a menu item 'no region')
contentValues:
Bind To: regionController (NSArrayController)
Controller Key: arrangedObjects
Model Key Path: name
x Inserts Null Placeholder (because I need a menu item 'no region')
Null Placeholder: no region
selectedIndex:
Bind To: regionController (NSArrayController)
Controller Key: selectionIndex
Thanks for helping!
Marc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden