views:

345

answers:

3

Hi,

It turns out that in order to do this one has to bind the NSSlider's Value to IKImageBrowserView's zoomValue.

My question is why it only works in this way? It seems more natural (to me) to bind IKImageBrowserView's zoomValue to NSSlider.intValue

Thanks!

+4  A: 
Christian Brunschen
That seems so obvious now. Thanks!
thesamet
+1  A: 

One alternate method for doing this is to bind both the image browser's zoomValue and the slider's value to the same key in another object. For example, if you wanted the zoom value to be remembered between relaunches of the app, you could bind both views to a particular key in the shared user defaults controller. Whenever either view changed, it would change the value in NSUserDefaults, then propagate through to the other view.

Brian Webster
Be aware, though, that the IKImageBrowserView's zoomValue binding is likely to be established before its containing window's size is restored from autosave. This will likely cause the binding to get out of sync, since zoomValue == 1.0 is an actual size determined by the view's bounds.
Fraser Speirs
+1  A: 

Because its not like a bind. its not like IKImageBrowserView's zoomValue became the slider's value. It means that the slider sends a message to the IKImageBrowserView to set the zoomValue to the slider's value.

zalavari