NSSlider and arrangedObjects
NSSlider and arrangedObjects
- Subject: NSSlider and arrangedObjects
- From: Tobias Wood <email@hidden>
- Date: Thu, 19 Jan 2012 11:03:26 +0000
Hi everyone,
I am attempting to bind an NSSlider to a property of every object in an NSArrayController, rather than just the current selection. There are other properties that are bound to the selection, but this particular one I want to change for everything, regardless. The array managed by the controller is initially empty when the program starts.
Binding the NSSlider's value to the NSArrayController's "arrangedObjects.propertyName" causes my program to get a SIGABRT on opening, with the following uncaught exception:
"Cannot create double from object ( ) of class __NSArray0"
I assume this is to do with the empty array. I have tried binding the NSSlider's enable to "arrangedObjects.@count" and "arrangedObjects.canRemove". Neither fixes the problem. If I bind the value to "selection.propertyName", the enabling/disabling works as expected (i.e. the slider is greyed out until the array has at least one entry). Hence I am confused.
Thanks in advance if you can help,
Toby
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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