This code works fine for single selections or multiple selections in the table with the same values for the selected objects.
NSNumber *currentValue = (NSNumber *)[mArrayController valueForKeyPath: mBindingKeyPath];
But if I have multiple selections with different values for the selected objects, I get this error and crash – which is correct because I do have multiple selections in my table. But of course I don't want to crash and instead get the selection as an array or how is it supposed to work?
2014-04-24 17:20:33.167 DC MacOSX[5746:303] -[_NSStateMarker floatValue]: unrecognized selector sent to instance 0x1006135a0 2014-04-24 17:20:33.168 DC MacOSX[5746:303] -[_NSStateMarker floatValue]: unrecognized selector sent to instance 0x1006135a0 2014-04-24 17:20:33.170 DC MacOSX[5746:303] ( 0 CoreFoundation 0x00007fff8b71bb06 __exceptionPreprocess + 198 1 libobjc.A.dylib 0x00007fff850b03f0 objc_exception_throw + 43 2 CoreFoundation 0x00007fff8b7b240a -[NSObject(NSObject) doesNotRecognizeSelector:] + 186 3 CoreFoundation 0x00007fff8b70a02e ___forwarding___ + 414 4 CoreFoundation 0x00007fff8b709e18 _CF_forwarding_prep_0 + 232 5 Dreamcatcher MacOSX 0x0000000100066199 -[CustomNSSliderJoystick1D mouseDragged:] + 434 6 AppKit 0x00007fff89a60b81 -[NSWindow sendEvent:] + 8504 7 AppKit 0x00007fff89a5c644 -[NSApplication sendEvent:] + 5761